RewriteRule that preserves GET parameters

后端 未结 3 1466
-上瘾入骨i
-上瘾入骨i 2020-11-30 13:14

What is wrong with this rewrite rule?

RewriteRule ^api/(.+)$ api/index.php?url=$1 [L]

I simply want \"index.php?url=\" to be added after ap

3条回答
  •  眼角桃花
    2020-11-30 13:31

    I think you must write your domain name before the regex stuff. Like this:

    RewriteRule ^(.+).com/api/(.*)$ "$1.com/api/index.php?url=$2" [R=301,L]
    

提交回复
热议问题