htaccess url as parameter

前端 未结 4 2004
小蘑菇
小蘑菇 2020-12-12 02:32

Hi all and thanks in advance, I\'m trying to add a url as a parameter but I can not. My rule is:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f  
Rewr         


        
4条回答
  •  無奈伤痛
    2020-12-12 03:13

    http://localhost/example/info/peter/hi/guy/http://www.example.com is not a valid URL for what you're trying to do. The URL part should be urlencoded. See this explanation, for example.

    The correct URL would be:

    http://localhost/example/info/peter/hi/guy/http%3A%2F%2Fwww.example.com
    

    Nothwithstanding this point, the error with your regex is greedy matching as described in another answer. However if you encoded the URL correctly, that wouldn't be a problem.

提交回复
热议问题