Force www. in your URL using .htaccess





1
Date Submitted Mon. Mar. 23rd, 2009 2:07 AM
Revision 1 of 1
Scripter mycodeofshailendra
Tags PHP
Comments 1 comments
Just add the following code to your .htaccess file in the highest folder of your web directory and yor visitors will be forced to use the www version.


 RewriteEngine on

    RewriteCond %{HTTP_HOST} !^www.your_domain.com$

    RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301]


 

shailendra bhadange

shailendra-problemsolution.blogspot.com/
Shailendra Bhadange

Comments

Comments Why on earth . . .
Tue. Aug. 11th, 2009 10:22 PM    Scripter sehrgut

Voting

Votes Down


Scripter sehrgut