Forum Moderators: phranque

Message Too Old, No Replies

Redirection problems :(

         

Ian_W

1:27 pm on May 31, 2003 (gmt 0)

10+ Year Member



Hi,

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.

jdMorgan

2:20 pm on May 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ian_W,

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

Ian_W

4:50 pm on May 31, 2003 (gmt 0)

10+ Year Member



Thanks - got it working :)

Okay, haven't quite managed out how to redirect individual files, but will get there soon :)