【发布时间】:2021-01-18 08:05:12
【问题描述】:
我是使用 Apache 2.4.18 的新手。
我想重定向以下格式的 URL。
Current URL: https://www.example.org/page/10/
Desired URL: https://www.example.org/index.php/page/10/
如果我使用以下规则,我可以修改请求,例如第 2 页:
Redirect permanent /page/2/ /index.php/page/2/
但是,我想重定向而不必对我网站上的所有页面进行硬编码。我尝试了以下方法,我的浏览器在多次重定向后失败:
RedirectMatch /page/(.*)/$ /index.php/page/$1/
并且使用以下失败,我不知道为什么:
RedirectMatch "https://www.example.org/page/(.*)/$" "https://www.example.org/index.php/page/$1/"
我做错了什么?
【问题讨论】:
标签: apache http-redirect