Reputation: 8413
I want to set up the redirect, which would bring any user from
http://vps.domain.com/~access/
(and subfolders, such as /~access/user
etc.)
to
http://www.example.com
What's the Rewrite rule I have to use?
Will that one work?
RewriteCond %{HTTP_HOST} ^vps.domain.com/~access/$
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
Thank you!
Upvotes: 0
Views: 16
Reputation: 785316
You can place this rule in ~access/.htaccess
:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^vps\.domain\.com$ [NC]
RewriteRule ^ http://www.example.com/ [L,R=301]
Upvotes: 2
Reputation: 12089
RewriteCond %{HTTP_HOST} ^vps\.domain\.com [NC]
RewriteCond %{REQUEST_URI} ^/~access/
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
Upvotes: 1