Skip to main content

what is htaccess?

.htaccess

.htaccess is a directory level configuration file used by Apache web server.

htaccess is a dot prefix file the name startes with a single dot ie .htaccess and has no file extension. You can change the file name from .htaccess to any other name you like ie htacess.txt by modifying your main server.config file.

.htaccess FAQs

What is htaccess

. htaccess is a directory level configuration file used by Apache web server. This is the file we use to create short/friendly URLs and to modify other settings of our web server.

How to enable htaccess

Nowadays almost all web hosting providers have the htaccess support enabled by default but in case it is not enabled you can enable it simply by adding `Allowoverride all` line to your main server.config file. If you don't have access to this file you can ask your hosting service provider to enable it for you.

Can we rename htaccess ?

Yes, you can rename the file by using ..... in your server.config. By default htaccess does not have any name and it is saved just by . htaccess extension for security reasons but you can name it or change the file name completely.

Is it ok to use htaccess?

Htaccess is the most used file on Apache web server. People prefer this file because it's available on all types of hostings. Some hosting providers don't provide access to server.config file and in that case the htaccess is the only file you can to customise your web server and rewrite URLs. Using htaccess to modify your server settings or URLs doesn't harm your web server but there is a slight impact on the performance of your server as it has to read the htaccess each and every time to serve the request.

What is mod-rewrite and how do I use it?

Apache server provides mod-rewrite a URL rewriting module to modify URLs . With mod-rewrite you can use URL Rewriting functionalities like RewriteRule in your htaccess and server configuration file to rewrite and chane the appearance of your server URLs. You can read more about mod-rewrite on the office Apache guide .