我创建了一个新的 Wordpress 页面,但无法在浏览器中访问它,并且我的 Apache 错误日志显示:
File does not exist: /var/www/website/wordpress/new-page, referer: http://new.comelody.com/wp-admin/post.php?post=315&action=edit
这是Aapche.conf
<VirtualHost *:80>
ServerName new.comelody.com
DocumentRoot /var/www/website/wordpress
RewriteEngine On
<Directory /var/www/website/wordpress>
AllowOverride all
Options -MultiViews
</Directory>
</VirtualHost>
这是主题内的 .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine on
#RewriteBase /test
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
</IfModule>
造成这种情况的原因是什么?
谢谢你!
答案1
将 Wordpress 中的 .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>