我刚刚移动了我的wordpress网站。移动除主页之外的所有页面都显示为404未找到。以下是我尝试过的步骤。
我已更改为默认永久链接,并且可以正常使用。
将以下代码添加到.htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
**RewriteCond %{REQUEST_URI} !=/server-status**
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
知道它可能是什么?链接是http://dev.pwlawyers.ca/
答案 0 :(得分:0)
您的服务器正在运行Nginx Web服务器,而.htaccess用于Apache Web服务器。
答案 1 :(得分:0)
我认为我已经修好了它:
如果您的wordpress安装位于文件夹的根目录中,请将其添加到配置文件位置块:
location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$args;
}
如果它位于文件夹中,例如wordpress文件夹,则添加:
location /wordpress/ {
try_files $uri $uri/ /wordpress/index.php?$args;
}
重新加载nginx,它应该没问题。
答案 2 :(得分:0)
添加过滤器
您可以通过插件(或主题功能等)添加以下过滤器:
// Stop WordPress from modifying .htaccess permalink rules
add_filter('flush_rewrite_rules_hard','__return_false');
由于