首页 > 解决方案 > WordPress 不加载静态文件

问题描述

今天安装 PolyLang 插件后,我的 wordpress 网站出现问题:

err_too_many_redirects

所以我按照一些教程在 cPanel 中中场了 .htaccess 文件:

前:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

RewriteRule ^$ https://www.ohyanlawgroup.com/home/ [L,R=301]
RewriteEngine On 
# RewriteCond %{HTTPS} off
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.ohyanlawgroup.com/$1 [R,L]

后:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule ^(.*)$ https://www.ohyanlawgroup.com/ [L,R=301]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.ohyanlawgroup.com/$1 [R,L]

现在 err_too_many_redirects 消失了。但是网站只能加载部分内容,似乎所有的静态文件都没有加载。

有朋友可以帮忙吗?

标签: phpwordpress.htaccesscpanelpolylang

解决方案


推荐阅读