htaccess - 301 setup problems- tried several work arounds.

Permalink
I am looking to incorporate a 301 fromhttp://name.com tohttp://www.name.com. I have tried several configurations and have not managed to sort it.

The configuration that I am using at the moment is:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
---------------------------------------

The configurations that I have played with that dont work are:

-----------------------------------------
1. Error: URIL is not valid and cant be loaded

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^mastercoachingcentre\.co.uk [NC]
RewriteRule (.*)http://www.mastercoachingcentre.co.uk/$1... [L,R=301]
</IfModule>

-------------------------------------
2.Error: Worked on root but url is not valid on all other pages

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^mastercoachingcentre\.co.uk [NC]
RewriteRule (.*)http://www.mastercoachingcentre.co.uk/$1... [L,R=301]
</IfModule>
---------------------------------------------
3.Error: url is not valid on sub pages


<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)http://www.mastercoachingcentre.co.uk/$1... [L,R=301]
</IfModule>
---------------------------------------------
4.error: works great on http:// & http:www. and url is not valid on sub pages sticks in a index.php in the middle of the string.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,R=301]
</IfModule>
------------------------------------------

Hope you guys who know what you are doing can help. :)

stephenlaw
 
stephenlaw replied on at Permalink Reply
stephenlaw
This has been resolved with the latest concrete5 update. Thankyou Glyn at katalysis.net for the concrete5 upgrade and the 301 info that I needed.