views:

61

answers:

1
+1  Q: 

mod_rewrite help

For some unknown reason, my rewrite rule does not fire. Can you advise ?

  • /extranet/.htaccess (1)
  • /extranet/stable/
  • /extranet/dev/
  • /extranet/dev/.htaccess (2)

The first .htaccess redirects all traffic to the stable folder, except for URLs specifically pointed at the dev folder. That works fine.

Inside the dev folder, the second .htaccess is supposed to rewrite /extranet/dev/foo/ to /extranet/dev/index.php?app=foo.

And that fails me.

IndexIgnore *
Options +FollowSymLinks
RewriteEngine On
 RewriteBase /
#--------------------------------------------
# FRIENDLY URLs
#--------------------------------------------

# if the following conditions are met, SKIP the rewriteRules.
RewriteCond %{REQUEST_FILENAME} -f [NC,OR]
RewriteCond %{REQUEST_FILENAME} -d [NC,OR]
RewriteCond %{REQUEST_URI} ^/(|_css/|_js/|_img/) [NC]
RewriteRule . - [L]


RewriteRule ^([A-Za-z0-9-]+)/?$ index.php?app=$1 [NC,QSA,L]
+2  A: 

The first alternation option of ^/(|_css/|_js/|_img/) is ^/ and that tested against REQUEST_URI is always true.

Gumbo
even if i remove the whole rewriteCond , only leaving the last rewriteRule directive, the rewrite does not fire up.
pixeline