【问题标题】:Mathias URL shortenerMathias URL 缩短器
【发布时间】:2012-09-13 14:02:15
【问题描述】:

我正在使用这个 URL 缩短器,但我很难设置它。 https://github.com/mathiasbynens/php-url-shortener

我已经设置了数据库,相应地更改了配置文件。我将文件放在一个子目录中,并从 .htaccess 文件中删除了 Rewritebase。

如果有人可以提供帮助,我不确定这两个脚本是什么意思? `## Favelets / Bookmarklets

提示

// js javascript:(function(){var%20q=prompt('URL:');if(q){document.location='http://yourshortener.ext/shorten?url='+encodeURIComponent(q)}}());

缩短此网址

// js javascript:(function(){document.location='http://yourshortener.ext/shorten?url='+encodeURIComponent(location.href)}());

【问题讨论】:

    标签: php javascript .htaccess url-shortener


    【解决方案1】:

    您询问的脚本在那里,因此您可以从该页面快速创建一个短 URL。

    提示将询问您要缩短哪个网址,而第二个提示将自动缩短您已经访问的页面。

    试一试:)

    【讨论】:

    • 当我尝试在输入值中使用它时,它似乎不起作用。它只是吐出javascript。 <input id="fe_text" type="text" value="javascript:(function(){document.location='http://chrisburton.me/shorten?url='+encodeURIComponent(location.href)}());" />
    • 如果您想直观地显示代码以便用户可以复制它,您需要对该 JavaScript 进行编码,使其不会执行。
    • 如果对您有帮助,您介意勾选这个答案吗?
    【解决方案2】:

    如果您将所有文件上传到您的主机然后替换

    http://yourshortener.ext/shorten?url=

    http://Yourdomain.com/shorten?url=

    【讨论】:

      猜你喜欢
      • 2021-04-24
      • 2011-08-20
      • 1970-01-01
      • 2019-12-13
      • 1970-01-01
      • 1970-01-01
      • 2023-03-28
      • 2010-12-18
      • 1970-01-01
      相关资源
      最近更新 更多