PDA

View Full Version : htaccess redirect to different style


cchhita
04-22-2005, 10:32 PM
Hi Everybody,

I have a question someone maybe able to help me with.
I have a vbulletin forum running on my main site (eg. www.mydomain.com). I also would like to show exactly the SAME forum on my second domain (www.myseconddomain.com), but with a different style.

Originally I had this in my htaccess:

Redirect http://www.myseconddomain.com http://www.myseconddomain.com/forumdisplay.php?f=1&styleid=6

So, everytime someone typed in www.myseconddomain.com in the URL, they would be taken to the specific forum style I have allocated.

This did not work, so I was told to try the following:

RewriteEngine on

RewriteCond %{HTTP_HOST} ^www.myseconddomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^myseconddomain.com$
RewriteRule ^(.*)$ http://www.myseconddomain.com/forumdisplay.php?f=1&styleid=6$1 [R=301,L]

Which seemed to work very well for a short time until I was told it created an infinate loop, becuase it is looking for www.myseconddomain.com when it is already there!!

Does anyone know how to achieve this using Htaccess?

Thanks