2

I simply just don want the client to access files from subdirectories directly, just by RewriteRule.

Example:

http://www.page.com/dostuff /dostuff should be rewritten to /php/dostuff.php and interpreted

but

http://www.page.com/php/dustuff.php will recieve 404

The problem is when I rewrite to the directory, the .htaccess will be executed for the subdirectory and I will allways get 404. I would like a solution without .htaccess for each subdirectory

here's my rule:

RewriteRule ^dostuff$ /php/dostuff.php [L]
RewriteRule ^css/(.*)$ /html/css/$1 [L]
RewriteRule ^js/(.*)$ /html/js/$1 [L]

Greets

luni

Book Of Zeus
  • 49,509
  • 18
  • 174
  • 171
bitluni
  • 219
  • 1
  • 7
  • `RewriteRule ^dostuff$ /php/dostuff.php [L] RewriteRule ^css/(.*)$ /html/css/$1 [L] RewriteRule ^js/(.*)$ /html/js/$1 [L] ` – bitluni Oct 27 '11 at 22:09
  • have no access restrictions yet because they diddnt work – bitluni Oct 27 '11 at 22:10
  • have you tried adding `RewriteCond %{REQUEST_FILENAME} !-f` and `RewriteCond %{REQUEST_FILENAME} !-d` in before the RewriteRules? Does the file /php/dostuff.php actually exist? I don't see how the rules are being applied more than once. You don't have `RewriteOptions Inherit` set somewhere, do you? – Jon Lin Oct 27 '11 at 22:33

0 Answers0