We Recommend

Pro Apache Pro Apache
In addition to installation, maintenance, and deployment, the book demonstrates how to configure Apache to use Perl, PHP, and Python as server-side scripting languages. And unlike other books on Apache, Pro Apache provides comprehensive information on both major revisions - 1.3 and 2.0 - of the software.


Posted By

fris on 12/27/07


Tagged

file rename rewrite


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

basicmagic


rename .php files to .html on the fly


Published in: Apache 


  1. Options +FollowSymLinks
  2. RewriteEngine On
  3. RewriteCond %{ENV:REDIRECT_STATUS} ^$
  4. RewriteRule ^(.+\.)php$ /$1html [R=301,L]
  5. RewriteCond %{SCRIPT_FILENAME} !-f
  6. RewriteRule ^(.+\.)html$ /$1php [QSA,L]

Report this snippet 

You need to login to post a comment.