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
精彩评论