# 免费开源网址缩短源码

*Published:* 2023-10-27
*Author:* 客服001

#### 温馨提醒

如果文章内容或图片资源失效，请留言反馈，我们会及时处理，谢谢

本文最后更新于2023年10月27日，已超过 180天没有更新



[![](https://www.xarjtc.com/wp-content/uploads/2023/10/urlshorting.jpg)](https://www.xarjtc.com/wp-content/uploads/2023/10/urlshorting.jpg)

**安装方法：**

1.下载源码。

2.上传至你的网站根目录。

3.访问网站域名填写mysql等信息进行安装。

4.修改网站伪静态配置:

Nginx:

```
if (!-e $request_filename) {
    rewrite ^/(.*)$ /index.php?id=$1 last;
 }
```

Apache：

```
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php?id=$1 [L]
</IfModule>
```

IIS：

```
<rule name="tool.apizl.com rewriteTools1" patternSyntax="ECMAScript" stopProcessing="true">
    <match url="^/(.*)" ignoreCase="false" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
    <action type="Rewrite" url="/index.php?id={R:1}" appendQueryString="false" />
</rule>
```

**其他提示：**

由于某些原因，该源码仍然使用Mysqli连接数据库，可能缺乏一定的安全性，使用时请注意使用WAF等平台进行保护。 该项目目前由k6o.top进行维护

源码下载：https://github.com/soxft/URLshorting