Mobile Number Tracker
Trace Mobile Number Earn Money Online

Check and Test .htaccess File for Correctness

Syntax and content of .htaccess file must be perfectly correct.
Samyak Lalit | November 4, 2013 (Last update: September 13, 2019)

Samyak Lalit is an Indian author and disability rights activist. He is the principal author and founder of projects like TechWelkin, WeCapable, Viklangta, Kavita Kosh among many others.

If you’re a webmaster, you need no introduction of the .htaccess file. This is probably the most critical file on your web server and a misconfiguration in .htaccess can cause havoc on an otherwise smoothly running website. To avoid misconfiguration, you should be able to test and check htaccess file to see if correct syntax has been used in it.

.htaccess file is used for directry-level access control in a website’s structure. Whenever an HTTP request is made to the server, this file is checked for a number of things including whether access to the requested resource is allowed or not. This file is also used a lot for different types of redirection. This is the file that should be used to redirect www to non-www domain (or vice versa)

As you can see, .htaccess is an extremely important file –it is therefore vital that it’s syntax remains perfectly correct. But the question is how to test .htaccess syntax without uploading the changes on live website?

Thankfully there are a few tools available out there to help you in this regard.

Syntax and content of .htaccess file must be perfectly correct.

Syntax and content of .htaccess file must be perfectly correct.

Use .htaccess Tester on Made With Love website

This utility on Made With Love website is really great. It not only tests the syntax of the code given by you but also it tells you the output of your code. Moreover, it gives information on how each and every line in your code worked. This helps you a great deal in debugging the code.



You need to enter htaccess code and a URL of your website for which the code is to be tested. You can enter other optional parameters as per your needs. The most useful feature of this utility is its debugger.


htaccesscheck website offers a simple tool to check syntax of code given by you. It tells you where your code is wrong and also tries to give suggestions as to how to remove these mistake.

It is highly recommended to use these utilities before uploading changed htaccess file on live server because a wrong syntax can cost you a lot of traffic and also trust rank on search engines.

Do let me know if you have a question related with this subject. Thank you for using TechWelkin.


3 responses to “Check and Test .htaccess File for Correctness”

  1. Nicolaas Willemen says:


    You can help me i’m looking for a way to redirect to a subdir, i found that, but i can’t find a way to make the browser showing only and nothing else.

  2. Alex says:

    Thanks for the info.

  3. Icon says:

    I had a lot of problems with my htaccess file, but this post has helped to solve a problem.


Leave a Reply

Your email address will not be published. Required fields are marked *