Forum Moderators: phranque
Have a problem with redirecting a site, ussing httpd.conf
I need to redirect the home page only to say domaina.com but all pages beneath it to domainb.com.
I can do a
redirect permanent / [domaina.com...]
to send the base URL to domaina.com - but then I need /test.asp to go to [domainb.com...]
I have tried various alternatives, but they either do the second part or the first - I can't get both to work together. :(
I have also tried various rewrite rules such as
RewriteRule ^/~(.+) [ww.domainb.com...] [R,L]
I have read so many tutorials, that I am now getting confused - can anyone offer some tips - thanks.
Tip: Try RedirectMatch [httpd.apache.org] and/or study the use of anchors to specify exact matches in regular expressions [etext.lib.virginia.edu] for use in mod_rewrite or RedirectMatch.
^/$ = "Only '/' and nothing else"
^/.+$ = "Slash followed by something else (required)"
HTH,
Jim