Diggbar modrewrite- How do they pass URLs through modrewrite?

前端 未结 2 1427
说谎
说谎 2020-12-10 08:37

With the new Diggbar, you can put http://digg.com in front of any URL that you are currently at and it will create a Digg short URL. I am only assuming they do

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-10 09:17

    You have to take the value from the request line because Apache removes empty path segments. The initially requested URI path /http://foobar/ becomes /http:/foobar/. But the request line (THE_REQUEST) stays untouched:

    RewriteCond %{THE_REQUEST} ^GET\ /(https?://[^\s]+)
    RewriteRule ^https?:/ index.php?url=%1 [L]
    

提交回复
热议问题