Redirects with htaccess

Technical support for webhosting Resellers, and questions which directly relate to their services.

Moderator: Admins

Post Reply
Cyril
newbie
Posts: 2
Joined: Sun Nov 12, 2006 10:08 am

Redirects with htaccess

Post by Cyril » Sun Nov 12, 2006 10:22 am

Hi,

A few months ago I set up 301 redirects on a domain name through the htaccess file. Now it seems that the server does not handle them anymore. I have used RedirectPermanent, Redirect 301 directives and rewrite rules, but with no success. Did you make any changes recently on the AllowOverride directive from the Apache Core ?

My htaccess looks fine to me :

Code: Select all

Options +FollowSymlinks
RewriteEngine on

RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [r=301,L]
Thanks for your assistance
Cyril

Cyril
newbie
Posts: 2
Joined: Sun Nov 12, 2006 10:08 am

Re: Redirects with htaccess

Post by Cyril » Sun Nov 12, 2006 1:15 pm

I found the solution. To whom may be interested :

To 'search engine friendly' redirect a domain name to another, use in your htaccess :

Code: Select all

Options +FollowSymlinks 
RewriteEngine on 

Redirect permanent http://www.olddomain.com http://www.domain.com 
Redirect permanent http://olddomain.com http://www.domain.com 

RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC] 
RewriteRule ^(.*)$ http://www.domain.com/$1 [r=301,L]

Post Reply