开发者

.htaccess Rewrite /... to /?url=

开发者 https://www.devze.com 2023-04-12 21:45 出处:网络
I am trying to rewrite URLs like this: http://url.maxk.me/abc to http://url.maxk.me/?url=abc, but for some reason it开发者_开发问答 is not working.

I am trying to rewrite URLs like this: http://url.maxk.me/abc to http://url.maxk.me/?url=abc, but for some reason it开发者_开发问答 is not working.

Please can you tell me what I am doing wrong?

RewriteEngine on
RewriteRule ^(?:.*)url.maxk\.me/(.*)/?$ url.maxk.me?url=$1


You shouldn't include the domain in the RewriteRule target resource.

It should look like the following if you want the "?url" part to be visible to the user:

RewriteRule ^(.*)$ http://url.maxk.me/?url=$1

Otherwise, if you don't want the user to see "?url", it should look like this:

RewriteRule ^(.*)$ ?url=$1


try using this:

RewriteRule  ^(.*)$   ?url=$1
0

精彩评论

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