Diggbar modrewrite- How do they pass URLs through modrewrite?

前端 未结 2 1430
说谎
说谎 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条回答
  •  醉话见心
    2020-12-10 09:21

    You're only looking for letters and numbers in that regular expression, so it won't pick up the colon and slashes. You're also using index.php in the example and message.php in the htaccess ;)

    You'll probably want something like this:

    RewriteEngine on
    RewriteRule ^http://(.+)$ /index.php?url=$1 [L]
    

    This makes sure you only catch URLs here, and you can still have regular pages! (Think about what would have happened if you went to example.com/index.php, you'd end up in an infinite loop.)

提交回复
热议问题