___|  _ \   |  |    |   |_ _|\ \     / ____|
 |     |   |  |  |    |   |  |  \ \   /  __|
 |   | |   | ___ __|  ___ |  |   \ \ /   |
\____|\___/     _|   _|  _|___|   \_/   _____| 

 --- A GOPHER-LIKE INTERFACE FOR HIVE BLOCKCHAIN ---

wordpress迁移/更换服务器后固定链接404错误

BY: @laosan | CREATED: Dec. 1, 2017, 1:21 p.m. | VOTES: 0 | PAYOUT: $0.00 | [ VOTE ]
症状
Nginx

> 在网站的Nginx配置文件的{ }位置之间添加如下代码,并重启Nginx

location / {
 try_files $uri $uri/ /index.php?q=$uri&$args;
}
Apache或litespeed

> 进入网站文件夹,编辑.htaccess,添加/编辑如下代码,并重启apache或litespeed

RewriteEngine On 
RewriteBase / 
RewriteRule ^/index\.php$ - [L]   # 就是在^ index\.php$ 加  /
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L]
TAGS: [ #wordpress ] [ #error404 ] [ #permalink ] [ #transfer ] [ #server ]

Replies

NO REPLIES FOUND.

[ BACK TO TRENDING ] [ BACK TO MENU ]
CMD>