
Originally Posted by
cpradio
Secondly, I don't know why you need that rewrite rule to begin with, you are performing an action Apache will do by default. Granted I guess you would need this rule if you are not applying any RewriteCond that tell it NOT to run the rule if there is a physical file or directory already established with that path.
Code:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
I took your two different approaches, and both seem to have fixed things.
Now can you help me understand why your code works?! 
Approach #1:
For my original approach, why does this work...
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^finance/$ finance/index.php [L]
...but this doesn't...
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/finance/$ finance/index.php [L]
Since "finance" is starting at the Web Root, I would think either would work?!
BTW, I originally had it like this...
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule /finance/$ finance/index.php [L]
...to disallow URL's like this...
http://local.debbie/TEST/finance/
Approach #2:
Code:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
#Match any kind of Section. PHP will decide if it's valid or not.
RewriteRule (.+)/$ articles/index.php?section=$1 [L]
Why is it that if I go to...
http://local.debbie/finance/
...then I am routed to...
http://local.debbie/finance/index.php
But if I go to, say....
http://local.debbie/legal/
...then I am routed to...
http://local.debbie/articles/index.phph?section=legal
I don't see how your code above distinguishes between these two URL's...
http://local.debbie/finance/
http://local.debbie/legal/
Sincerely,
Debbie
Bookmarks