一个简洁的域名缩短服务网址缩短源码分享

一个简洁的域名缩短服务网址缩短源码分享

说明

CRZ.im是一个网址缩短服务的网站,所用的源码基于PHPSQLite进行开发,总大小仅10K左右,十分轻巧。

演示图

图片[1]-一个简洁的域名缩短服务网址缩短源码分享-乡野博文

使用方法

上传程序源码到网站根目录,

如果你的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目录权限设置为可读写即可。

温馨提示:本文最后更新于2022-06-20 20:53:03,某些文章具有时效性,若有错误或已失效,请在下方留言或联系乡野博文
您阅读这篇文章共花了: 0小时00分00秒
-----本页内容已结束,喜欢请分享!-----
一个简洁的域名缩短服务网址缩短源码分享-乡野博文
一个简洁的域名缩短服务网址缩短源码分享
此内容为付费资源,请付费后查看
100积分
付费资源
© 版权声明
THE END
喜欢本站内容,请点【点赞】【分享】和【收藏】~
点赞7 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容