Adrian World Design
  • Services
    • Website Consulting
    • Startup Consulting
    • Zend Development
  • Portfolio
    • My Framework
  • Knowledge
    • Web Standards
    • PHP bare-bones
    • Zend Framework
    • Zend Framework 2
    • Git - Github
    • Search Engine Optimization
    • Web Hosting
    • Linux
    • Microsoft Windows
    • Web Browsers
    • Mobile Devices
  • About
    • Business
    • Professionally
    • Personally
  • Contact
    • Contact Form
    • Phone
    • Email
    • Messaging

Knowledge Base Overview

Test if htaccess is working

Knowledge ⇒ Web Hosting ⇒ Tips and Tricks ⇒ Test if htaccess is working
Tweet
Share on Tumblr

Created: Nov 10, 2012, 8:29:13 AM CSTLast updated: Nov 12, 2012, 7:21:47 AM CST

When you set up a new website with an Apache (httpd) Web Server you may use the .htaccess configuration file with some site specific configuration directives. For some unexpected reason every rule fails and you wonder if the htaccess configuration file is even enabled or read. Why is it not working?

When all rules fail first thing we should do is verify if the htaccess file is accessed and the configuration loaded. There is obviously no need to look over the rules when it's not touched.

Force an error

The simple solution to verify and check if the .htacess configuration file is even touched and parsed is forcing an error. More precisely a 500 Internal Server Error.

Force an Internal Server Error

In order to do that you simple add something to the first line of the config file that doesn't make any sense. This could be a single letter or number, a word, basically anything that is not a directive.

If you get the 500 Internal Server Error you know that the file has been read because that line triggered the error.

If you don't get an error your server setup is wrong because your .htaccess has not even been touched. Check out the other documents in my knowledge base for answers to that question.

Further help

If you are not sure what the .htaccess file is, here's a quick info straight from the Apache Configuration Files documentation.

Apache allows for decentralized management of configuration via special files placed inside the web tree. The special files are usually called .htaccess, but any name can be specified in the AccessFileName directive. Directives placed in .htaccess files apply to the directory where you place the file, and all sub-directories. The .htaccess files follow the same syntax as the main configuration files. Since .htaccess files are read on every request, changes made in these files take immediate effect.

For more information check out the Apache tutorial or the link above.

blog comments powered by Disqus
Prev
Next

Powered by FeedBurner Load our "Knowledge Base" feed in your RSS feeder

Follow us on Twitter
Follow us on Facebook
Follow us on LinkedIn
Follow us on Google+

All rights reserved, Adrian World Design ©2009–2021 Powered by Wejas Framework

Jump to Top