桐木舟学英语人工智能

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 177|回复: 0

Opencart3.0开启伪静态(宝塔面板Nginx环境)

[复制链接]

351

主题

100

回帖

2231

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
2231
发表于 2025-7-4 11:24:32 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

x
Opencart网站,开启伪静态。
记录一下对应伪静态配置规则,适合opencart 3.0.3.9, 3.0.3.8,以备不时之需。
中文官网伪静态教学视频回想起最新的opencart3.8目录里有一个Nginx的伪静态配置文件nginx.conf,于是尝试直接把内容复制到宝塔面板的站点伪静态规则配置中,保存。

location / {
try_files $uri @opencart;
}
location @opencart {
rewrite ^/sitemap.xml$ /index.php?route=extension/feed/google_sitemap last;
rewrite ^/googlebase.xml$ /index.php?route=extension/feed/google_base last;
rewrite ^/payment_callback/(.*) /index.php?route=extension/payment/$1/callback last;
rewrite ^/callback/(.*) /index.php?route=extension/module/social/login&provider=$1 last;
rewrite ^/system/download/(.*) index.php?route=error/not_found last;
rewrite ^/blog$ /index.php?route=panda/blog last; rewrite ^/(.+)$ /index.php?_route_=$1 last;
}
location /admin/ {
index index.php;
}
location = /robots.txt {
allow all;
}
location ~* (\.(js|css|png|jpg|jpeg|gif|ico|otf|eot|svg|ttf|woff|woff2))$ {
expires max;
}
location ~* (\.(tpl|ini|twig|log))$ {
deny all;
}


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|桐木舟论坛

GMT+8, 2025-7-12 00:29 , Processed in 0.049941 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表