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.


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 in name field, it might end up as a Spam. Thanks for reading.

Last 5 Articles

All Articles >

  1. Multiple Serialisers in Django ModelViewSet

  2. Security Myths

  3. Model Design for Orders in Django

  4. Automating Business Operations

  5. Unit Testing in Python using assertAlmostEqual


News Letter

Subscribe to our email newsletter for useful tips and valuable resources, sent out every new article release.