2009-08-11 128 views
1

由于某些未知原因,我的重写规则不会触发。你能建议吗?mod_rewrite帮助

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

第一htaccess的所有通信重定向到稳定文件夹,除了网址特别指出在dev文件夹中。这工作正常。

dev文件夹中,第二个.htaccess应该将/extranet/dev/foo/重写为/extranet/dev/index.php?app=foo

这让我失望了。

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

^/(|_css/|_js/|_img/)第一个交替选择是^/和测试针对REQUEST_URI总是正确的。

+0

即使我删除整个rewriteCond,只留下最后一个rewriteRule指令,重写不会启动。 – pixeline 2009-08-11 14:39:06