Are you working with HTML or PHP and want to hide HTML PHP extension
from URL, This article is perfect for you. It makes your website more
SEO friendly. I’ll show you how to do that easily, by editing the
.htaccess file.
.htaccess is a configuration file for use on web servers running the Apache Web Server software.
you have to copy/paste the following code inside the .htaccess file or if you do not have .htaccess file then create new file copy below code and paste in the file ans save with .htaccess file and upload it on server root directory.
Just replace last line of the code.
More: There is one online tool also available to create .htaccess online.
Please let us know your views in comment section below and read our other PHP/WordPress articles.
How to Hide HTML PHP extension
.htaccess file allows you to hide extension..htaccess is a configuration file for use on web servers running the Apache Web Server software.
1. Hide PHP Extension
To remove the .php extension from a PHP file for example mywebsite.com/page.php to mywebsite.com/pageyou have to copy/paste the following code inside the .htaccess file or if you do not have .htaccess file then create new file copy below code and paste in the file ans save with .htaccess file and upload it on server root directory.
# Turn on the rewrite engine
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
2. Hide HTML Extension
To remove .html extension from html file for example mywebsite.com/page.html to mywebsite.com/pageJust replace last line of the code.
# Turn on the rewrite engine
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
More: There is one online tool also available to create .htaccess online.
Please let us know your views in comment section below and read our other PHP/WordPress articles.
Recently, I have commenced a blog the info you give on this site has encouraged and benefited me hugely. Thanks for all of your time & work. hide wp login path
ReplyDeleteBathing your pet often is important to help lessen allergic reactions they may cause. Pet dander (skin flakes) and saliva on your pet's fur can cause allergies. Pets can often bring in allergens from outside the home into your home, too.play bazaar satta king
ReplyDeleteThis is my first time visit to your blog and I am very interested in the articles that you serve. Provide enough knowledge for me. Thank you for sharing useful and don't forget, keep sharing useful info: hide my wp
ReplyDeleteVery nice article, I enjoyed reading your post, very nice share, I want to twit this to my followers. Thanks!. hide my wp
ReplyDeleteVery useful info. Hope to see more posts soon!. Hide WordPress plugin
ReplyDelete