How to hide .php from the URL?
There are various types of scripts used to make a page in website. For example HTML, PHP, ASP etc. This page will show their extensions in URL like https://website.com/index.html or https://website.com/index.php
This will look odd when extension is visible and that is not seo friendly too. Do you know we can hide this using .htaccess file? Yes, today I will explain how you can hide this extensions.
.htaccess have lots of applications. Another application is, it will allow you rewrite facility. That means you can define what will be your page extension then if you not mention the .php or .html then server automatically put the extension and thus user will not get any 404 error. For example if one of your url is like: https://website.com/about.php Then if you hit it https://website.com/about without setup .htaccess then user will get a 404 error. But if you create a .htaccess file on root directory and then hit the desired url then u can see it will be working.
Htaccess Code for hiding extension
Instead of .php from the code if you put .html or .asp then it will work for that extension. See its very easy. Apply and enjoy!
Leave your Comment