.htaccess simple redirection

Hi experts,

Here is a simple .htaccess question

presidentevil

My goal is to redirect presidentevil.fr to www.presidentevil.fr

I use that:

SetEnv PHP_VER 5
RewriteEngine on
Rewritecond %{HTTP_HOST} ^presidentevil.fr$
Rewriterule ^(.*) http://www.presidentevil.fr/$1 [QSA,L,R=301]

It seems the htaccess is active because If I remove
SetEnv PHP_VER 5
I got php errors.

Troubles is : when I type in presidentevil.fr it does not redirect to www. !
What am I doing wrong ?


regards

yarekGmailAsked:
Who is Participating?
 
boon86Commented:
try

Options +FollowSymLinks 
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^presidentevil.fr [NC] 
RewriteRule ^(.*)$ http://www.presidentevil.fr/$1 [L,R=301] 

Open in new window

0
 
quizwedgeCommented:
I'm no expert at .htaccess, but check out the generator at http://www.htaccessredirect.net/index.php Looks like the syntax is a little off.

For a non-generator based solution, check out http://kb.mediatemple.net/questions/85/Using+.htaccess+rewrite+rules#gs/add-www-or-https
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.