Hide Extension

Hide Extension

Hide Extension

In this tutorial we'll create .htaccess file that will hide the extension of the file type.
Hide Extension

You may see URL’s like

and many other without any extension. With this script in your .htaccess file of the directory you can have URL’s like this

This also works even with extension also this can be useful to hide the file type you use.

To do this start a notepad if you use a windows or gedit if you use a linux or any other text editor.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

Then copy the following code to it and save it as .htaccess and upload it to your root directory.
If you use .html the replace the .php with .html and upload the file

NOTE:This works only for php for html read the above instruction.

About the Author


Anush is a freelance web designer and developer with a passion for interaction design. He founded Tech Stream in mid 2011 to spread the art of web design and programing Skills.


Wow ! you have someting to tell us. That's great! Please keep in mind that comments are moderated, we employ rel="nofollow" for links, avoid using a spammy word or a domain as your name, it might end up as a spam. Thanks for reading.

comments powered by Disqus

Back to Top