Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mod_rewrite Avoiding "inheritance"

Status
Not open for further replies.

BostonChowder

Technical User
Sep 8, 2001
8
US
I am using mod_rewrite to take all non-existant .htm files called and change them into .php then direct those called files that still do not exist to one file which works magic to run a web site.

THe following is in a .htaccess file:

RewriteEngine on

rewritecond %{REQUEST_FILENAME} !-f
rewriterule ^/(.*)\.htm /$1.php [L]

rewritecond %{REQUEST_FILENAME} !-f
rewritecond /home/dir1/public_html/sys_config.php -f
rewriterule ^(.*)$ /sys_config.php [L]


This works great with domain.com/file.htm but I don't want it messing with subdirectories.

Right now the best I can do is throw another .htaccess into subdirectories to counteract it, but that is a nuissance when other people are adding directories as well.

Any suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top