开发者

mod_rewrite rewriting a url

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?i开发者_运维问答d=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.


Are you sure it is index.php and not page.php?

Please try

RewriteRule ^/page/([^/]+)$ /index.php?page=$1 [L]

If you need a permanent move

RewriteRule ^/page/([^/]+)$ /index.php?page=$1 [R=301,L]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜