开发者

Need to add $_GET args to my regex

开发者 https://www.devze.com 2022-12-27 16:41 出处:网络
url.rewrite开发者_高级运维-once = ( \".*\\.(js|ico|gif|jpg|png|css|html)$\" => \"$0\", \"^/([^?]*)(\\?.*)?$\" => \"/$1.php/$2\",
    url.rewrite开发者_高级运维-once = (
    ".*\.(js|ico|gif|jpg|png|css|html)$" => "$0",
    "^/([^?]*)(\?.*)?$" => "/$1.php/$2",
)

This is what I got but the args don't work. I like following url

http://www.example.com/index.php/?r=something

To look like this:

http://www.example.com/index/?r=something

Thanx


If /index/?r=something is requested, it is rewritten to /index/.php/?r=something. So try this rule:

"^/([^?]*[^?/])/?(\?.*)?$" => "/$1.php/$2"

With this pattern the trailing slash is optional.

0

精彩评论

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

关注公众号