Web Designing

How To Hide .HTML Extension In Website Address Bar?

Hey, today I’ll tell you How To Hide .HTML Extension In Website Address Bar? If you want to know, keep reading this post.

First of all, let me tell you that many people make their website with HTML and PHP, etc, but when it publishes your website, the .HTML extension is displayed in the address bar of the website. Do not look good at that?

How To Hide .HTML In Website Address Bar

So guys, today we will tell you a way you can hide .HTML Extension by using it. And After that, you can also visit your website .HTML Extension.

How To Hide .HTML Extension In Website Address Bar?

Friends, you are appearing in the address bar of your custom website. To hide the .HTML extension, first, you go to the Cpanel of your website. Or go to Public_html and create a file called .htaccess.

Also Read: Best Digital Marketing Company In Dehradun, Uttarakhand?

And Then open this file. And this code which we have given you below. Or It has to be pasted into this .htaccess file.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L] 

Let me tell you that this code can be used only for the website created by HTML. And if you have created a website with PHP, then you can use this code.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L] 

After using Save in this code in the .htaccess file, you can make any URL of your website without .HTML and .PHP extension. You can also see the image given above. For more information, please watch this video.

video

So hopefully, now you can also hide your website’s .HTML extension using these codes. And if you liked this post, or you have got to learn anything from it. You can tell us in the comment box.

Besides, if you use FacebookTwitter, and Instagram, you can follow us there too. Because we keep updating it even daily. And thank you very much for reading How To Hide .HTML Extension In Website post.

Tags

Mr Rahman

Hey, I'm Rahman. Founder & CEO of Oflox, India's #1 Digital Marketing Institute & Company? And I'm a Software Engineer from Education and Profession By Developer, Blogger, YouTuber, and Graphic Designer.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Close