emlog如何配置服务器支持 URL 重写(伪静态规则)_
Nginx
- 宝塔面板:站点设置 - 伪静态 - 选择emlog的规则 - 点击保存即可
- 手动配置:修改 Nginx 配置文件在站点相关配置中增加如下规则:
location / {
index index.php index.html;
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php last;
}
}
Apache
根目录下已经配置了静态规则文件 .htaccess 文件,内容如下:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteBase /
RewriteRule . /index.php [L]
</IfModule>
如果静态规则没有生效,需要修改Apache服务器配置开启支持.htaccess,检查 http.conf 配置文件:
- 确保已加载mod_rewrite模块,去掉如下配置行前的#注释符号
LoadModule rewrite_module modules/mod_rewrite.so - 将AllowOverride指令设置为All
AllowOverride All

更新时间:2026-03-08 14:01:24
上一篇:帝国cms生成内容页提示“Table '_.phome_ecms_' doesn't exist......update ____ecms_ set havehtml=1 wh
下一篇:错误内容:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server ve
