WordPress的永久链接不起作用

Hitu禁令

我已经将WordPress网站迁移到新的服务器(Ubuntu),它工作正常。

但是永久链接设置不起作用。所有其他页面均返回404错误。

我已经启用 mod_rewrite

当我使用自定义结构并键入/%postname%时,它显示Permalink结构已更新。并在访问页面时返回404错误。

我将/ var / www / html / wordpress安装目录/用作文件夹,并且将/ etc / apache2 / sites-available / 000-defaul-config更改为

DocumentRoot / var / www / html / wordpress安装目录

及以下在我的.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

知道有什么问题吗?

泰米尔·塞尔文C

尝试https://codex.wordpress.org/Using_Permalinks#Fixing_Other_Issues

未启用AllowOverride您的服务器可能未启用AllowOverride指令。如果Apache httpd.config文件中的AllowOverride指令设置为None,则.htaccess文件将被完全忽略。在这种情况下,服务器甚至不会尝试读取文件系统中的.htaccess文件。当此伪指令设置为All时,.htaccess文件中将允许具有.htaccess上下文的任何伪指令。httpd.config中启用的AllowOverride指令示例:

<Directory />
    Options FollowSymLinks
    AllowOverride All
 </Directory>

您可能还必须在DocumentRoot中启用AllowOverride指令:

<Directory /var/www/html>
    # ... other directives...
    AllowOverride All
 </Directory>

You may also have to change the AllowOverride settings for the site. This is surely the case when using Mac OS X Server, but might be likewise with other systems. Usually you can find the site configuration files in /etc/httpd/sites/ 

If you don't want to set AllowOverride to all (as it is above) then your AllowOverride list must include the FileInfo directive. You must restart your Apache server for any httpd.config file changes to take effect. For more information on which overrides are allowed, read about Apache Core Features. 

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章