.htaccess Rewrite /... to /?url=
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
精彩评论