Help - Search - Members - Calendar
Full Version: redirect htaccess file extentions
Movable Type Community Forum > Additional Resources > Tips and Tricks
mkelley
I want to move my site to a php-based file system. Right now, all of my archive files are *.html and I want to change that to *.php without screwing up the linking on search engines and other sites.

Does anyone know how to redirect html to php with an htaccess file? If I try wildcards *.html or any other changes, I get a 500 error.
girlie
Does something like this work?

CODE
RedirectMatch permanent ^(.*)\.html$ $1.php
mkelley
Thanks! That works.
bmk
You can run php in .html files by adding this to your htaccess:
AddType application/x-httpd-php .html .php

Then you don't have to change the extensions at all.
girlie
Ya know, it's funny - that was the first thing I went looking for - the thread where you posted that. Then I thought, oh, that's not what he/she wants!

Duh to me!!

:0
mkelley
I tried that first bmk and it doesn't work with my host.  But thanks for all of the help.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.