Reputation: 6282
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
. How can I redirect to mysite.com/subsite/ex/page1
?
How can I append the remaining part of url also to new url pattern?
Upvotes: 0
Views: 72
Reputation: 15552
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
Upvotes: 1