4th Street Bar Hive-Bar

Hive-Bar Powered by Hive beta-fdb5b5b

Community post

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

症状
  • 迁移/更换服务器后,wordpress站点首页正常;
  • 若固定链接格式为默认格式,自定义就404错误;
Nginx

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

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

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

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase / 
RewriteRule ^/index\.php-[L]#index\.php- [L]   # 就是在^ index\.php 加  /
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
</IfModule>
0 upvotes $0.00

Replies (0)

Conversation

No replies yet

Replies will appear here as people join the conversation.

Review before signing

Posting as . Signing with . Keychain permission: Posting. Hive Keychain will ask you to approve this action next.


  
Technical details

Operation fingerprint: