2012-08-14 125 views
1

我使用这个htaccess的代码在生产服务器上工作,但在XAMPP不工作,可我知道为什么Zend框架的htaccess工作在生产服务器上而不是在XAMPP

RewriteEngine On 
RewriteRule ^\.htaccess$ – [F] 
RewriteCond %{REQUEST_URI} =”" 
RewriteRule ^.*$ /public/index.php [NC,L] 
RewriteCond %{REQUEST_URI} !^/public/.*$ 
RewriteRule ^(.*)$ /public/$1 
RewriteCond %{REQUEST_FILENAME} -f 
RewriteRule ^.*$ – [NC,L] 
RewriteRule ^public/.*$ /public/index.php [NC,L] 
+0

如果检查的mod_rewrite都已启用 – Oussama 2012-08-14 15:31:13

+0

,没有运气 – ktm 2012-08-14 16:14:22

回答

-1

在第三行,你有一个非法性格:

RewriteCond %{REQUEST_URI} =”" 

应该

RewriteCond %{REQUEST_URI} ="" 
+0

纠正,没有运气 – ktm 2012-08-14 16:14:37

-1

即使改变非ASCII双后引用一个ascii双引号,该条件应该总是失败,因为="",apache将尝试将URI(总是以斜杠开头)与字符=匹配。尝试改变这两条线:

RewriteCond %{REQUEST_URI} =”" 
RewriteRule ^.*$ /public/index.php [NC,L] 

到:

RewriteRule ^$ /public/index.php [L] 
相关问题