Howto test .htaccess

knowledge base and frequently asked questions
Post Reply
User avatar
leo
admin
Posts: 4320
Joined: Sun Dec 13, 2009 8:27 am
Location: Hungary

Howto test .htaccess

Post by leo » Wed May 23, 2012 6:51 am

How to test that the content of the .htaccess file is taken into consideration by your apache2 web server?
Open your .htaccess file and write into the last line the word test.
So, original .htaccess:

Code: Select all

.
.
</IfModule>
# Try if you have problems with url alias
# RewriteRule ^(.*) index.php [L,QSA]

# Focus on one domain - Uncomment to use
# RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
# RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
After modification:

Code: Select all

.
.
</IfModule>
# Try if you have problems with url alias
# RewriteRule ^(.*) index.php [L,QSA]

# Focus on one domain - Uncomment to use
# RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
# RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
test
Save it, then refresh your shop in your browser.
If you get this error:

Code: Select all

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
everything works fine.
If not - and you are on production server - ask you web service provider to enable .htaccess files.

Post Reply