Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have changed a website from .html extensions to .php; the file names are the same, and there are thousands of files. There is php code now which cannot be parsed with .html

Basically, since now all the files have a .php extension, I want to rewrite the url of all html files to become .php

In other words, if someone visits:
mysite.com/page.html


then they are taken to:
mysite.com/page.php


Additionally, I need it to LOAD the .php page, not just change the URL.

How can I do this in .htaccess?

p.s. at last what appears to be a viable alternative to stackoverflow! Some a**hole took this question and said "duplicate question" and linked to an article about the basics of htaccess. They obviously have no idea what the word "duplicate" means! That generic page didn't even have anything remotely close to my question there! Not to mention there was another question that did the opposite that no one said was a duplicate!
Posted
Updated 10-Jan-15 18:37pm
v2

1 solution

You should use Google more...
There are some very nice articles about the subject of URL rewriting under Apache...
Some samples to start with:
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html[^]
http://24ways.org/2013/url-rewriting-for-the-fearful/[^]
 
Share this answer
 
Comments
Member 11366169 11-Jan-15 18:03pm    
f*** YOU bitch. Go back to stackoverflow where you belong.
Kornfeld Eliyahu Peter 12-Jan-15 1:59am    
You have all the right to not to accept a solution, but please keep your language clean!
Member 11366169 11-Jan-15 18:04pm    
bad answer. Google it yourself. Those are general pages. Bitch.
Kornfeld Eliyahu Peter 12-Jan-15 1:59am    
You have all the right to not to accept a solution, but please keep your language clean!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900