开发者

Rewrite Conditions in htaccess file

RewriteCond %{HTTP_HOST} ^mysite.com$
RewriteCond %{REQUEST_URI} ^/ex-ex[/]*
RewriteRule ^(.*)$ /subsite/ex [R=permanent,L,NE]

I am redirecting mysite.com/ex-ex to mysite.com/subsite/ex

This is working fine, but mysite.com/ex-ex/page1 redirects to mysite.com/subsite/ex. H开发者_开发百科ow can I redirect to mysite.com/subsite/ex/page1?

How can I append the remaining part of url also to new url pattern?


This would do it:

RewriteCond %{HTTP_HOST} ^mysite.com$
RewriteRule ^/ex-ex(.*)$ /subsite/ex$1 [R=permanent,L,NE]

Edit: added a slash in the Rule

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜