retagged by
944 views
0 votes
0 votes
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

How can I do this in .htaccess?
retagged by

3 Answers

0 votes
0 votes

This is not  a programing website :) But let me help you. 
you can redirect from your html to php page by meta tag in head 

<meta http-equiv="refresh" content="0; url=http://your.com/index.php" />
0 votes
0 votes

put this line in html file

<script>window.location = "mysite.com/page.php";</script>

htaccess doesn't support renaming file

0 votes
0 votes
RedirectMatch 301 (.*)\.html $1.php

No related questions found