Remove .php and .html extensions from URL using htaccess

August 31, 2017
11 Shares 683 Views
2 Comments
Like
Like Love Haha Wow Sad Angry
12

All the time, Web Developer doesn’t want to show file extensions in URL like .html or .php

Now the main thing is how to hide .php and .html from URL without coding the lengthy program or using the complex method.To remove PHP and HTML from URL, use the .htaccess file. That’s the simple & quickest way to remove extensions from URL.

Related Blog: Force redirect to HTTPS using .htaccess file in PHP

Create .htacces File

To create the .htaccess file. Go to Root Directory of your project and create a new file named as .htaccess

Code to hide PHP Extension from URL:

To hide the PHP extension from the URL, paste the below code in your .htaccess file.

Code to hide HTML Extension from URL:

To hide the HTML extension from the URL, paste the below code in your .htaccess file.

After adding these lines of code, you can run your HTML/PHP files on browsers without extensions.
That’s all for Today. We’ll be coming soon with some interesting technical blog at WEXT.in Community.

Stay tuned with us at WEXT.in Community.

 

Like
Like Love Haha Wow Sad Angry
12

Comments

comments

You may be interested

Apply for Voter ID Card Online
Govt of India
15 shares287 views
Govt of India
15 shares287 views

Apply for Voter ID Card Online

Anupama Bhandari - Apr 13, 2018

As per Indian Government, Everyone in India needs to have their own Voter Identity Card to vote the right candidate.…

अब दिल्ली मे दम नही
Hindi
10 shares298 views
Hindi
10 shares298 views

अब दिल्ली मे दम नही

Bijender Singh Bhandari - Apr 03, 2018

मेरा इस दिल्ली मे जन्म हुआ था ये सुन्दर शहर तब दिल मे बसा था कल्पना न थी जो दशा…

How to manage your time at exam preparation?
eLearning
3 shares283 views
eLearning
3 shares283 views

How to manage your time at exam preparation?

WEXT.in Team - Mar 03, 2018

Exams are a real test of your prowess to make the time available to exhibit as much as possible and…

2 Responses

  1. I have been browsing online more than three hours today,
    yet I never found any interesting article like yours.
    It’s pretty worth enough for me. Personally, if all website owners
    and bloggers made good content as you did,
    the web will be much more useful than ever before.

    Reply
  2. You really make it seem so easy with your presentation but
    I find this topic to be actually something which I think I would never understand.
    It seems too complicated and very broad for me.
    I am looking forward to your next post, I’ll
    try to get the hang of it!

    Reply

Leave a Comment

Your email address will not be published.