短网址程序:测试

© ㄒiger / Posted in 主机域名 / June 8, 2012

好吧,网易短网址http://126.am.正版 http://126.pm 为山寨的...

早上用126.am下午用126.pm短网址

等待DNS生效中....等待修改程序中....继续用phurl or yourls...

Waiting.....

© ㄒiger / Posted in 主机域名,程序代码 / November 26, 2011

短网址http://baid.us最近一直502....  被某些程序一直在提交..生成了很多垃圾数据。想到了禁止这个域名..网上搜了下..

.然后自己修改尝试了下,结果成功了。。。

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

修改phurl中index.php

查找 else {
        $hostname = get_hostname();
        $domain   = get_domain();

        if (preg_match("/($hostname)/i", $data['host'])) {
            $_ERROR[] = "The URL you have entered is not allowed.";
        }
    }

修改为:

 else {
        $hostname = get_hostname();
        $domain   = get_domain();

        if (preg_match("/($hostname)/i", $data['host'])) {
            $_ERROR[] = "The URL you have entered is not allowed.";
        }
     if (preg_match("/abc\.com/i", $data['host'])) {
            $_ERROR[] = "The URL you have entered is not allowed";
        }
  }

添加红色部分就行。 蓝色部分是域名abc.com 替换成其他的即可。

phurl blacklist domain

© ㄒiger / Posted in 主机域名,程序代码 / November 15, 2011

phurl 短网址程序

nginx伪静态规则: 

location / {

            rewrite ^/(.+)$ /redirect.php?alias=$1 last;

        }
apache规则

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteOptions MaxRedirects=1
   RewriteBase /
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-l
   RewriteRule ^([a-zA-Z0-9_-]+)$ redirect.php?alias=$1 [L]
</IfModule>
  • 分页: