SUMMARY: Apache Redirect on Solaris 8

2007-12-25 4:39:00

Thanks a lot to Dale Ghent, Frank Van Liedekerke and VEGH Karoly.
Special thanks to Dale...

The solution is:

RewriteCond %{HTTP_HOST} ^www\.test1\.com$
RewriteRule ^(.*)$ http://www.test2.com$1 [R=permanent]

Worked for me after I figured out it silly mistake I made was put
forward slash after $1.

My original question was:

Hi Gurus,

I have Apache 1.3.26 installed on Solaris 8. I am trying to redirect a
web site with Apache rewrite rule as below:

e.g. redirect www.test1.com <http://www.test1.com/> to www.test2.com
<http://www.test2.com/>

RewriteCond %{HTTP_HOST} .*www.test1.com.*

RewriteRule ^/(.*) http://www.test2.com$0
<http://www.test2.com$0/> [R]

It redirects fine but address bar doesn't show the redirection. It still
shows www.test1.com <http://www.test1.com/> instead of www.test2.com
<http://www.test2.com/>

In my DNS below is the entry

www.test1.com <http://www.test2.com/> IN CNAME www.test2.com
<http://www.test2.com/> .

What could be wrong?

Any help pointer will be appreciated.

TIA

B
_______________________________________________
codeprof mailing list
codeprof at codeprof.com
http://www.codeprof.com/execute/ask/?codeinfoid=35148

Comments

Got something to say?

You must be logged in to post a comment.