当我在WordPress中打开新创建的页面时,我得到了page not found,但是当我将permalinks重置为none时,http://localhost/?page_id=6通常会打开。
即使使用这个permalink,它也能工作:/index.php/%postname%/,但是当我将它更改为/%postname%/时,就会得到page not found error。
这是我的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]
</IfModule>
# END WordPress发布于 2016-01-08 12:50:55
启用mod_rewrite了吗?
这类事情往往会在不发生的时候发生。此时,您只能访问丑陋的permalinks (?p=N)或“几乎漂亮”的permalinks (/index.php/slug)。后者使用pathinfo为您提供所请求的页面。
因此,我建议再次检查mod_rewrite是否已安装和启用。如果不是,则启用它并重新启动Apache。
这是关于使用WP法典中的permalinks的更多信息。
发布于 2016-01-08 05:18:29
这个问题是.htaccess文件的。在做任何事情之前,先备份您的文件和数据库。
然后在.htaccess安装的根目录中重命名WordPress文件。然后在WordPress仪表板中更改所需的permalink设置。
我希望这对你有用。
https://wordpress.stackexchange.com/questions/213939
复制相似问题