.htaccess 301 Redirect [duplicate]
.htaccess 301 Redirect [duplicate] -
Solution :
Additionally, if you would like to do some further testing, give the htaccess tester tool a try. It allows you to specify a certain URL as well as the rules you would like to include and then shows which rules were tested, which ones met the criteria, and which ones were executed.
.htaccess files are extremely useful in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about htaccess, 301-redirect, no-www, , .htaccess common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your .htaccess file running smoothly.Problem :How do I make it so all traffic is directed for the entire site and all subdirectories from non-www to www.
Here is my .htaccess contents:
RewriteEngine on
<IfModule mod_suphp.c>
suPHP_ConfigPath /home/vivalast
<Files php.ini>
order allow,deny
deny from all
</Files>
</IfModule>
RewriteCond %HTTP_HOST ^example.com$
RewriteRule ^(.*)$ "http://www.example.com/$1" [R=301,L]
Try this:
RewriteEngine on
RewriteCond %HTTP_HOST ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,NC]
Comments
Post a Comment