in Web Technologies retagged by
967 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?
in Web Technologies retagged by
967 views

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" />

1 comment

NOPE wrong answer
0
0
0 votes
0 votes

put this line in html file

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

htaccess doesn't support renaming file

by

1 comment

NOPE wrong answer

and you're stupid if you think htaccess doesn't support renaming file

0
0
0 votes
0 votes
RedirectMatch 301 (.*)\.html $1.php
by
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true