Reputation: 553
I want to ask, how do I redirect from this url(for example): http://firstapp.com/VD/Controller/Action (VD - is virtual directory, Action - there are many actions, so all of them should be redirected to the new url)
to this one: http://secondapp.com/Action ?
Using .htaccess
I try this, but it does not work
RewriteCond %{HTTP_HOST} ^(.*)$ [NC]
RewriteRule ^/VD/Controller/(.*)$ http://secondapp.com/$1 [L,R=301,NC]
Upvotes: 0
Views: 73
Reputation: 785146
Place this rule in root .htaccess of firstapp.com
:
RewriteEngine On
RewriteCond %{HTTP_HOST} firstapp\.com$ [NC]
RewriteRule ^VD/Controller/(.*)$ http://secondapp.com/$1 [L,R=301,NC]
Upvotes: 1