开发者

HTAccess bug. GET doesn't seem to come through correctly

I'm using the following htaccess:

Options +FollowSym开发者_运维问答Links
Options +Indexes
RewriteEngine On

RewriteBase /
RewriteRule ^CuraXL/(.*)$  "CuraXL/index.php?pageRequest=$1"
RewriteRule ^CuraXL/(.*)/$  "CuraXL/index.php?pageRequest=$1"

When Doing the following in php:

<?php echo $_GET['pageRequest']; ?>

It outputs "index.php". Instead of what i request being "about-us".

Any idea what's up?


No, CuraXL/index.php is also matched by ^CuraXL/(.*)$. You need to exclude the destination you are rewriting to:

RewriteCond $1 !=index.php
RewriteRule ^CuraXL/(.*)/?$  CuraXL/index.php?pageRequest=$1


Remove the quotes around the index.php bit in the .htaccess

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜