mod_rewrite 重写 url
嘿,有人可以伸出援手,让重写规则发挥作用吗?
我正在开发一个 CMS,目前的 URL 看起来像这样
page.php?id=2/About-us
我想删除
page.php?id=2/
URL 的一部分并仅显示
About-us
有什么想法如何使其工作吗?
编辑
我已经将我的URL更改为
page/PAGE_NAME
并使用了规则
RewriteRule ^page/([^/\.]+)/?$ index.php?page=$1 [L]
但是,apache只是说在服务器上找不到index.php。
Hay, can someone lend a helping hand to get a rewrite rule to work?
I'm developing a CMS and the URL currently look like this
page.php?id=2/About-us
I want to remove the
page.php?id=2/
part of the URL and just show
About-us
Any ideas how to get this working?
EDIT
I have since changed my URLS to
page/PAGE_NAME
and used the rule
RewriteRule ^page/([^/\.]+)/?$ index.php?page=$1 [L]
However, apache just says that index.php was not found on the server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您确定它是
index.php
而不是page.php
吗?请尝试
如果您需要永久搬家,
Are you sure it is
index.php
and notpage.php
?Please try
If you need a permanent move