MyBB Community Forums

Full Version: Playing with .htaccess file and need help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Ok what I am trying to do is the following:

If people visit:

http://www.MYDOMAIN.co.uk/forums/index.php

they get redirected to:

http://www.MYDOMAIN.co.uk/forums/

Also if people visit:

http://MYDOMAIN.co.uk/forums/

they get redirected to:

http://www.MYDOMAIN.co.uk/forums/

To do this I tried adding the following to the .htaccess file:

RewriteCond %{HTTP_HOST} ^MYDOMAIN.co.uk/forums/ [NC]
RewriteRule ^(.*)$ http://www.MYDOMAIN.co.uk/forums/$1 [L,R=301]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.MYDOMAIN.co.uk/forums/ [R=301,L]

I added it below this:

RewriteEngine on

But the thing is it does not make any difference, I have used the above code on other (non MyBB) websites with no problem.

I am using the Google SEO mod if that makes a difference? Any help would be amazing Smile
HTTP_HOST is host only, it does not contain a /forums/ path.

A generic non-www to www redirect:

RewriteCond %{HTTP_HOST} !^www\.mydomain\.co\.uk$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.co.uk/$1 [L,QSA,R=301]

Index Redirect (no Cond necessary, at least not for me):
RewriteRule ^index\.php$ http://www.mydomain.co.uk/forums/ [L,QSA,R=301]
Thank You that seems to have sorted it Smile