我冒了风险,启动了主题,看看会发生什么。root需要完成主题激活才能将规则添加到中。htaccess。在此之前,不会加载任何CSS/JS,主题预览也不会缺少样式表。
它会改变股票的走势。htaccess:
# 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]
RewriteRule .*\\.git/.* - [F]
</IfModule>
进入更长的领域,包括
RewriteRule ^assets/css/(.*) /wp-content/themes/roots/assets/css/$1 [QSA,L]
RewriteRule ^assets/js/(.*) /wp-content/themes/roots/assets/js/$1 [QSA,L]
RewriteRule ^assets/img/(.*) /wp-content/themes/roots/assets/img/$1 [QSA,L]
RewriteRule ^plugins/(.*) /wp-content/plugins/$1 [QSA,L]
它还添加了样板HTML。htaccess规则,并删除了我的。git规则;尽管测试显示Git文件夹不可访问,但为了安全起见,我还是要将其重新添加进去。