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
精彩评论