共计 1326 个字符,预计需要花费 4 分钟才能阅读完成。
测试环境
宝塔 Nginx -Tengine2.2.3 的 PHP5.6 + MySQL5.6.44
为防止调试错误,建议使用测试环境运行的 php 与 mysql 版本
首先用 phpMyAdmin 导入数据库文件 db/db.sql
如果导入不行,请直接复制数据库内容运行 sql 语句也可以
再修改 config.php 来进行数据库配置
然后在服务器设置好伪静态规则
访问网站 OK
后台是:你的域名 /admin/login.php 账号:admin 密码:qqqqqq
Nginx 伪静态规则
rewrite ^/index.html$ /index.php;
rewrite ^/about.html$ /about.php;
rewrite ^/search.html$ /search.php;
rewrite ^/ranking.html$ /ranking.php;
rewrite ^/wz.html$ /wzall.php;
rewrite ^/apply.html$ /apply.php;
rewrite ^/404.html$ /404.php;
rewrite ^/sort([1-9]+[0-9]*).html$ /sort.php?id=;
rewrite ^/sort([a-zA-Z]+).html$ /sort.php?alias=;
rewrite ^/site_([1-9]+[0-9]*).html$ /site.php?id=;
rewrite ^/wz([1-9]+[0-9]*).html$ /wz.php?id=;
rewrite ^/wzshow_([1-9]+[0-9]*).html$ /wzshow.php?id=;
Apache 伪静态规则
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 ^wz.html wzall.php [L,NC]
RewriteRule ^apply.html apply.php [L,NC]
RewriteRule ^404.html 404.php [L,NC]
RewriteRule ^sort([0-9]+).html sort.php?id= [L,NC]
RewriteRule ^sort([a-zA-Z]+).html sort.php?alias= [L,NC]
RewriteRule ^site_([0-9]+).html site.php?id= [L,NC]
RewriteRule ^wz([0-9]+).html wz.php?id= [L,NC]
RewriteRule ^wzshow_([0-9]+).html wzshow.php?id= [L,NC]
IIS 伪静态规则(请查看压缩包中的版本简单说明)
下载地址:https://suyan8.lanzoub.com/iN0IA1xhf2ze