【发布时间】:2023-04-11 06:33:01
【问题描述】:
我的 .htacess 文件不仅对重定向很重要,对网站的外观也很重要。我不确定为什么这个主题的开发者会这样做,但我无法改变。
如果您导航到http://akcrossfit.com,您将看到该网站应有的样子。当您导航到 https://akcrossfit.com 时,您会看到没有样式的网站,并且任何导航都会导致 404 错误。
这是我的 .htaccess 文件:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^other/(.*) /wp-includes/$1 [QSA,L]
RewriteRule ^file/(.*) /wp-content/uploads/$1 [QSA,L]
RewriteRule ^ext/(.*) /wp-content/plugins/$1 [QSA,L]
RewriteRule ^skin/main\.css //index.php?style_wrapper=1 [QSA,L]
RewriteRule ^skin/(.*) /wp-content/themes/richer-child/$1 [QSA,L]
RewriteRule ^richer/(.*) /wp-content/themes/richer/$1 [QSA,L]
RewriteRule ^skin_main/(.*) /wp-content/themes/richer/$1 [QSA,L]
RewriteRule ^ajax /wp-admin/admin-ajax.php [QSA,L]
RewriteRule ^wp-content/themes/richer-child/screenshot\.png|readme \.html|license\.txt|wp-content/debug\.log|wp-includes/$ /nothing_404_404 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
知道要改变什么来解决这个问题吗?该网站托管在 Google Cloud Compute Engine 上。提前感谢您的帮助
这是我的 VHost 配置(至少是与本主题相关的部分)<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
ServerName akcrossfit.com:443
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
【问题讨论】:
-
您在访问日志中看到了什么?
标签: wordpress apache .htaccess google-compute-engine