我使用标准的Zend /public/.htaccess
文件(如下所示)。URL编码参数打破默认的Zend重写规则
目前我正在尝试将用户转发给特定的控制器/操作,并且将成功重定向URL作为URL参数提供。
所得URL(组装经由Zend的URL视图助手编码&)看起来像这样:
localhost/crop/index/successRedirect/localhost%2Fprofile%2Fbasic
然而这种模式显然违反了默认,Zend的包mod_rewrite的规则:访问所述URL产生一个标准的Apache 404错误; Zend没有收到请求。
当手动重新形成的最终参数如下,该请求可以作为所希望的:
localhost/crop/index/?successRedirect=localhost%2Fprofile%2Fbasic
然而,这需要一个hackish的,两步URL生成处理。如果视图助手生成的URL独立工作,那将是理想的。
可以做些什么来允许url编码通过?任何有识之士将不胜感激!
这些都是我的.htaccess的内容
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
启用RewriteLog像这样不产生输出的故障模式:
RewriteLogLevel 9
RewriteLog "<path>/rewrite.log"
我试图通过以下两个Q提出的解决方案& A的,没有变化:
- Adding encoded chars to the url breaks htaccess(
AllowEncodedSlashes On
) - Mod Rewrite and Using PHP's GET for URL's When not Following the Rules(使用
QSA
伪指令重写规则)
这个建议的解决方案也没有效果:http://stackoverflow.com/questions/6520484/mod-rewrite-urlencoding-an-already-urlencoded-querystring-parameter-any-way-to - 添加'NE'指令以'重写规则' – 2012-02-02 22:11:47