开发者

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

开发者 https://www.devze.com 2023-01-29 17:23 出处:网络
I\'m using the following htaccess: Options +FollowSym开发者_运维问答Links Options +Indexes RewriteEngine On

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

精彩评论

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