WCQ-259397 Print

  • 0

RewriteEngine On
#trailing slash fix
RewriteCond %{DOCUMENT_ROOT}/www2%{REQUEST_URI}/ -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]
#actual domain uri rewrite
RewriteCond %{HTTP_HOST} ^(www\.)?domain.com*
RewriteCond %{REQUEST_URI} !/www2/
RewriteRule (.*) /www2/$1

Way 2 :

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?domain2\.com$ [NC]
RewriteCond %{DOCUMENT_ROOT}/domain2%{REQUEST_URI}/ -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} ^(www\.)?domain2\.com$ [NC]
RewriteRule ^(.*)$ /domain2/$1 [QSA,L]

Was this answer helpful?

« Back