开发者

htaccess URL Rewrite not working after 301 redirect

I have the following url rewrite:

RewriteRule ^info/([^/\.]+)/?$ info.php?page=info&subpage=$1 [L]

Originally the parameters were the page id's i.e. 0-10. I have now changed this so the URLs have more meaningful slug names to reflect the content.

I have now set up the 301 redirects, for example:

Redirect 301 /info/0 http://www.example.com/info/intro

But the problem is, the redirect doesn't go to the url rewrite (http://www.example.com/info/intro). Instead it shows the full url (http://www.example.com/info.php?page=info&subpage=0)

开发者_StackOverflow社区

How can it get it to keep the rewrite?

Many thanks


As posted by LazyOne, the solution was to use RewriteRule:

RewriteRule ^info/0$ http://www.example.com/info/intro [R=301,L] 
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜