apache - redirect url with mod_rewrite at .htaccess and keeping domain ending -
i try that:
www.domain1.com/some-ending
or domain1.com/some-ending
www.domain2.com/some-ending
if url called or without www, second domain should opened corresponding ending (/some-ending), variable.
this code far, need ending in there:
rewriteengine on rewritecond %{http_host} ^(www\.)?domain1\.com$ [nc] rewriterule ^(.*)$ http://www.domain2.com/$1 [r=301,l]
your code looks ok , added optional "/" pattern can accept url ending "/" , "nc" flag case-insenstivity.
rewriteengine on rewritecond %{http_host} ^(www\.)?domain1\.com$ [nc] rewriterule ^(.*)/?$ http://www.domain2.com/$1 [r=301,l,nc]
Comments
Post a Comment