说明
想自己搭一个“hao123”?试试「我爱导航系统 Pro版」——把 SiteHub 扒皮拆骨重写的开源网址站,完全免费,前台+后台都给你整得明明白白。
亮点一句话:访客能自己提交网址,系统自动抓 TDK、图标,后台一键审核;还能顺手发发文章,SEO 两不误。
服务器咋配?
– web 服务:Nginx 或 Apache 都行
– PHP:7.4 最香
– 数据库:MySQL 5.6 起步
装起来超简单:把代码丢到网站根目录,访问域名就跟着引导点鼠标,十分钟收工。
Nginx 用户把下面这段复制到站点配置,刷新重载即可:
“`
rewrite ^/index.html$ /index.php last;
rewrite ^/about.html$ /about.php last;
rewrite ^/search.html$ /search.php last;
rewrite ^/ranking.html$ /ranking.php last;
rewrite ^/apply.html$ /apply.php last;
rewrite ^/404.html$ /404.php last;
rewrite ^/category-([1-9]+[0-9]*).html$ /category.php?id=$1 last;
rewrite ^/category-([a-zA-Z]+).html$ /category.php?alias=$1 last;
rewrite ^/site-([1-9]+[0-9]*).html$ /site.php?id=$1 last;
rewrite ^/article.html$ /article.php last;
rewrite ^/article-list-([1-9]+[0-9]*).html$ /article_list.php?id=$1 last;
rewrite ^/article-([1-9]+[0-9]*).html$ /article_show.php?id=$1 last;
rewrite ^/img/favicon/(.*)$ /favicon.php?url=$1 last;
rewrite ^/img/favicon/(.*).png$ /favicon.php?url=$1 last;
rewrite ^/img/preview/(.*).png$ /preview.php?url=$1 last;
location ~ “^/img/favicon/([^/]+)/?.png$” {
try_files /$uri /$uri/ /favicon.php?url=$1;
}
location ~ “^/img/preview/([^/]+)/?.png$” {
try_files /$uri /$uri/ /preview.php?url=$1;
}
“`
Apache 党也别急,根目录建个 .htaccess,粘进去保存:
“`
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ index.php [L,NC]
RewriteRule ^about\.html$ about.php [L,NC]
RewriteRule ^search\.html$ search.php [L,NC]
RewriteRule ^ranking\.html$ ranking.php [L,NC]
RewriteRule ^article\.html$ article.php [L,NC]
RewriteRule ^apply\.html$ apply.php [L,NC]
RewriteRule ^404\.html$ 404.php [L,NC]
RewriteRule ^category-([0-9]+)\.html$ category.php?id=$1 [L,NC]
RewriteRule ^category-([a-zA-Z]+)\.html$ category.php?alias=$1 [L,NC]
RewriteRule ^site-([0-9]+)\.html$ site.php?id=$1 [L,NC]
RewriteRule ^article-list-([0-9]+)\.html$ article_list.php?id=$1 [L,NC]
RewriteRule ^article-([0-9]+)\.html$ article_show.php?id=$1 [L,NC]
RewriteRule ^img/favicon/(.*)\.png$ favicon.php?url=$1 [L,NC]
RewriteRule ^img/preview/(.*)\.png$ preview.php?url=$1 [L,NC]
“`
前台 UI 走极简卡片风,后台是毛玻璃拟态,颜值在线;手机端自适应,谁看谁爽。
代码全开源,想改色、加字段、套模板随便折腾,商用也无套路。
演示图
感谢您的来访,获取更多精彩文章请收藏本站。


暂无评论内容