说明
CRZ.im
是一个网址缩短服务的网站,所用的源码基于PHP
、SQLite
进行开发,总大小仅10K
左右,十分轻巧。
演示图
![图片[1]-一个简洁的域名缩短服务网址缩短源码分享-乡野博文](http://www.zau.cn/wp-content/uploads/2022/06/1489.jpg)
使用方法
上传程序源码到网站根目录,
如果你的web服务是Nginx
需要设置伪静态
接下来设置Nginx
伪静态,在网站配置文件中添加以下代码:
<span class="hljs-comment">#root后面为网站根目录</span>
<span class="hljs-attribute">location</span> / {
<span class="hljs-attribute">try_files</span> <span class="hljs-variable">$uri</span> <span class="hljs-variable">$uri</span>/ =<span class="hljs-number"><a href="https://www.ly522.com/tag/404" title="查看所有文章关于 404" target="_blank">404</a></span>;
<span class="hljs-attribute">rewrite</span> (\d+|\w+)$ /index.php?id=<span class="hljs-variable">$1</span>;
<span class="hljs-attribute">location</span><span class="hljs-regexp"> ^~</span> /asset/ {
<span class="hljs-attribute">root</span> /var/www/xx.com;
}
<span class="hljs-attribute">location</span><span class="hljs-regexp"> ^~</span> /api/ {
<span class="hljs-attribute">root</span> /var/www/xx.com;
}
<span class="hljs-attribute">location</span><span class="hljs-regexp"> ^~</span> /inc/ {
<span class="hljs-attribute">return</span> <span class="hljs-number">403</span>;
}
}
最后只需要修改config.php
的相关配置并把inc
目录权限设置为可读写即可。
您阅读这篇文章共花了: 0小时00分00秒
THE END
暂无评论内容