Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter
Support for Vanilla Forums Cloud product

Follow Us


.htaccess rules not working for forum

edited July 2011 in Questions
Hi,

I have my forum in the directory forum but have an .htaccess file in the root with the following rules.
[code]
RewriteCond %{HTTP_HOST} ^www.domain1\.com$ [OR]
RewriteCond %{HTTP_HOST} ^domain1\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.domain2\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.domain2\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.maindomain\.co\.uk$
RewriteRule (.*) http://maindomain.co.uk/$1 [R=301,L]
[/code]

This works perfectly fine for the site apart from when viewing the /forum directory, the domain doesn't redirect. So for example

domain1.co.uk/forum
should redirect to
maindomain.co.uk/forum
But it doesn't

The below works fine
domain1.co.uk/anotherdirectory

I tried adding the same rules to the vanilla forum .htaccess file but still no joy. This is what i added there.

[code]

RewriteEngine On

RewriteBase /forum
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php\?p=$1 [QSA,L]

RewriteCond %{HTTP_HOST} ^www.domain1\.com$ [OR]
RewriteCond %{HTTP_HOST} ^domain1\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.domain2\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.domain2\.co\.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www\.maindomain\.co\.uk$
RewriteRule (.*) http://maindomain.co.uk/$1 [R=301,L]

[/code]

I've tried using different base, just "/" and also "/forum/". But nothing. Any suggestions.

Thanks in advance.

Ben
Sign In or Register to comment.