How to remove .php, .html from url using htaccess
Published on :

When we are working with core functionality like php or html then the url is come with the file extension like .php,.html,.htm.jsp but its not look like user friendly, the process of remove file extension from the end in url is called url re-writing. there is a easy way to remove it from url just follow this blog instruction, if you are using simple server then you just need to create .htaccess file and need to write some  rules on it.

 


Step 1 :  Create .htaccess file

  • the filename is only .htaccess nothing come front of the file name
  • make sure in your server url re-writing is enabled
  • Put below code in .htaccess file
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

 

The above code is remove the .php file extension from url you can use its for all types of file but you just need to replace .php to other extension.

 



Please follow and like us:

Leave a Reply