Removing file extensions in htaccess
Category: Cpanel
I think I have finally figured out how to get pretty urls; www.mysite.com/about.html is showing mysite.com/about. So i think I have the htaccess file correct. My question is that Google and Bing still show all urls with .html extension. I think I have to redirect old .html sites to new urls but couldn't get it to work last night. Can anyone help me with this? I resubmitted site under new url to both Google and Bing, but i think i will still have to redirect?
Thanks
Thanks
OTHER ANSWERS
|
0
|
Hello MtnBeachBum, You were on the right track, but the htaccess needed a bit of tweaking. I saved the original for you as .htaccess1 and the .htaccess file running is the modified one. I replaced that bit of rewrite code with the following code: RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{THE_REQUEST} ^GET\ /[^?\s]+\.html RewriteRule (.*)\.html$ /$1 [L,R=301] This allows the mysite.com/about to display even if the user types in mysite.com/about.html and the Search engines redirect properly now as well. I hope this answers your question. If you have any more questions or information specific to the issue please leave a comment below so we can further assist you. Best Regards, Scott M |
Like this Question?
Tweet
Latest Questions
If you need some help, submit your question to our Community!
We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)
Recent QuestionsNeed more Help?
Search
Ask the Community!
Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.
Current Customers
| Chat: | Click to Chat Now | E-mail: | support@InMotionHosting.com |
|---|---|---|---|
| Call: | 888-321-HOST (4678) | Ticket: | Submit a Support Ticket |


