rewrite *.htm/*.html to *.php (Yep, real newbie here)

New to mod_rewrite? This is a good place to start.

rewrite *.htm/*.html to *.php (Yep, real newbie here)

Postby wtl » Mon Oct 07, 2002 12:00 pm

That's the first thing I want to do, and I need to do it fast. I'm in mod_rewrite kindergarten, and just thought I'd get a quick tip from you graduates, before I dig into understanding everything, and rewriting all my variable laden PHP URLs.

Thanks!
wtl
 
Posts: 1
Joined: Mon Oct 07, 2002 11:57 am

RE: rewrite *.htm/*.html to *.php

Postby snewman » Fri Dec 13, 2002 12:14 pm

This should work:

RewriteRule ^(.*)\.html?$ $1 [C]
RewriteRule ^(.*) $1.php [R]

The ? after the html makes the trailing "L" optional.
snewman
 
Posts: 1
Joined: Fri Dec 13, 2002 12:13 pm


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 34 guests

cron