Forum Moderators: phranque

Message Too Old, No Replies

Problems with redirect

         

ibad

2:34 pm on Sep 19, 2005 (gmt 0)

10+ Year Member



I have two websites with the same contents and I want to redirect one site to the other.
I modified my apache config:
LoadModule rewrite_module modules/mod_rewrite.so

RewriteEngine on
RewriteRule /site_A_homefolder/ http**://site_B.com/

It works in my computer hosting site A. When I visit
http**://site_A.com at this computer, it will be redirect to http**://site_B.com/
However, when I visit Site A from any other computer, I got no response.

Can anyone help?

ibad

4:20 pm on Sep 19, 2005 (gmt 0)

10+ Year Member



I also tried:
RewriteEngine on
RewriteRule ^/site_A_homefolder/(.+)
http**://site_B.com/$1 [R]

I got the same problem.

jdMorgan

4:58 pm on Sep 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ibad,

Welcome to WebmasterWorld!

We're going to need a lot more information in order to suggest anything.

Are your sites hosted on separate servers?
What appears in your server error log when 'it doesn't work'?
Have you tried using the simpler RedirectPermanent directive of mod_alias [httpd.apache.org], rather than mod_rewrite?

The more information you post, the more likely someone will spot something that might need to be changed.

Jim

ibad

5:50 pm on Sep 19, 2005 (gmt 0)

10+ Year Member



hello jim,
Site_A and Site_B are hosted at different servers. I have access to both computers A and B.
A runs apache under windows 2000 Pro; while B runs apache under ox 10.4.

1) In the case of the following setting:
RewriteEngine on
RewriteRule ^/site_A_homefolder/(.+) http**://site_B.com/$1 [R]

When I visit http**://site_A.com/ from A computer, I get some info from access.log
site_A_ip - - [19/Sep/2005:13:27:01 -0400] "GET /site_A_homefolder/ HTTP/1.1" 301 316
I was redirected to http**://site_B.com/
If I I visit http**://site_A.com/ from B (or any other but A) computer,
I get no response and there is no info added to error.log or access.log file.

2) I also tried
Redirect permanent /site_A_homefolder/ http**://site_B.com/
I get the same info from both log files at Site_A.

ibad

5:42 pm on Sep 20, 2005 (gmt 0)

10+ Year Member



Problem Solved:
It turns out that my server is somewhat down(?).
I tested the configuration at other computers,
there was no problem. Thanks.
-----ibad