.htaccess redirect foo.com/ to /foo.htm, leave bar.com/ as bar.com -
note: had add spaces because thought posting links...
i have 2 sites coming 1 server , 1 folder (foo.com
, bar.com
). foo.com
needs point @ page named foo.htm
under root of site. has requirement of not changing url.
if url bar.com
needs left alone.
if full url http://www.foo.com/
needs switched equivalent of
http://bar.com/foo.htm
does make sense?
i have following works every page except root page, isn't redirecting foo.htm
.
rewriteengine on rewritecond %{http_host} ^foo\.com rewriterule ^(.*)$ http://www.bar.com/$1 rewriterule ^$ /foo.htm [l]
rewriteengine on rewritecond %{http_host} ^foo\.com rewritecond %{request_uri} ^/?$ rewriterule ^$ http://www.bar.com/foo.htm [l] rewritecond %{http_host} ^foo\.com rewritecond %{request_uri} ^/. rewriterule ^(.*)$ http://www.bar.com/$1
i'm not sure if run can't test - if doesn't work, modify regex in rewritecond %{request_uri} .... possibly remove slash , question mark... try it.
Comments
Post a Comment