Help - Search - Members - Calendar
Full Version: Changing from .html to .php in dynamic
Movable Type Community Forum > Additional Resources > Tips and Tricks
Koldark
I have just got dynamic templates working for me. However, I have ran into a small problem. A long time ago I switched from .html to .php extensions. I had this code
CODE
# Change .html to .php
RewriteEngine on
RewriteBase /
#RewriteCond /www/m/mnwills/htdocs%{REQUEST_URI} !-f
RewriteCond /www/m/mnwills/htdocs/$1.php -f
RewriteRule ^/*(.*)\.html$ $1.php [R=301,L]

in my .htaccess file to take care of that problem. Well, with the dynamic templates for some reason, this doesn't work anymore. I have placed this code after some 301 redirects I have in the file and before the MT code that 3.121 added to my .htaccess. Is there any reason why this doesn't work? Is there a way to make this work? Or, if I have to, how do I modify MT to handle this?
Koldark
Any ideas anyone?
Koldark
No ideas on this anyone? Do you need clarification?
Christine
Just curious - why do you want to rewrite the .html files to .php? I don't know the answer to your question, but I do know it is possible to tweak your .htaccess file to make it parse .html pages as .php. I did it for years on my site. Would that solution meet your needs?
iki
When I switched over from html to php, I used Kadyellebee's little changeover guide here in the forums:

PHP Changeover

Worked like a charm. Maybe that will help you?

-Iki
Koldark
QUOTE (Christine @ Nov 22 2004, 07:20 PM)
Just curious - why do you want to rewrite the .html files to .php?  I don't know the answer to your question, but I do know it is possible to tweak your .htaccess file to make it parse .html pages as .php.  I did it for years on my site.  Would that solution meet your needs?

Well, normally the code posted above works, but after I moved to dynamic templates, that doesn't work. There are many sites out there that like to the .html file, not the .php file. To elimiate some of the 404 errors, I would like to get this to work.
Koldark
QUOTE (iki @ Nov 22 2004, 07:57 PM)
When I switched over from html to php, I used Kadyellebee's little changeover guide here in the forums:

PHP Changeover

Worked like a charm. Maybe that will help you?

-Iki

I already have it changed to PHP, I just want to have is some who enters mylink.html to have the webserver cahnge it to mylink.php. The origonal .htaccess code I posted worked up until I changed to dynamic templates, now it doesn't work. I am just wondering why and how to fix it.
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.