Forum Moderators: phranque

Message Too Old, No Replies

Redirecting traffic with some exceptions

What condition statements do I need to use to make this work?

         

WillyWonka

12:29 am on May 7, 2006 (gmt 0)



I am trying to write a mod rewrite command in my .htaccess which redirects traffic to my main index.php so that it can work with textpattern, but I need some exceptions for stuff like phpMyAdmin which is in a passworded directory.

My current .htaccess in the root folder of the web site overrides the .htaccess in the passwd'd directory so you can never log in.

This is what I want to happen:

1)
http://www.example.com/
/u/b/brent/www.example.com/index.php

2)
http://www.example.com/phpMyAdmin
/u/b/brent/www.example.com/phpMyAdmin/index.php
(This folder has a .htaccess which should ask for a username/password)

3)
http://www.example.com/directory/which/doesnt/really/exist
/u/b/brent/www.example.com/index.php

jdMorgan

6:05 am on May 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To exclude the phpMyAdmin subdirectory from being affected by a RewriteRule, add a Condition:

RewriteCond %{REQUEST_URI} !^/phpMyAdmin
RewriteRule <your pattern and substitution>

For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].

Jim