404问题原因
伪静态没有配置正确,Chevereto 默认提供基于 Apache 环境的伪静态规则,如果服务器是 Nginx 则需要设置伪静态规则
解决办法
在 server 下加入以下配置:
1
2
3
|
location / {
try_files $uri $uri/ /index.php?$query_string;
}
|
官方推荐配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# Disable access to .ht* files
location ~ /\.ht {
deny all;
}
# Disable access to sensitive files in app path
location ~ /(app|content|lib)/.*\.(po|php|lock|sql)$ {
deny all;
}
# Disable log on not found images + image replacement
location ~* (jpe?g|png|gif) {
log_not_found off;
error_page 404 /content/images/system/default/404.gif;
}
# Enable CORS header (needed for CDN)
location ~ \.(ttf|ttc|otf|eot|woff|woff2|css|js)$ {
add_header Access–Control–Allow–Origin “*”;
}
# Force serve upload path as static content
location ~ /images {}
# Route dynamic request to index.php
location / {
try_files $uri $uri/ /index.php?$query_string;
}
|