Hide Extension

Hide Extension

Advert

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

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

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.

Comments

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. Text Area Widget in Django Admin

     
  2. Control ViewSet Method in Django

     
  3. CSS Colors

     
  4. Creating a Website that Converts

     
  5. Generate Variables from string in Javascript

     

News Letter

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