简体   繁体   English

WordPress永久链接和.htaccess文件问题

[英]WordPress permalinks and .htaccess file issue

I'm using the WordPress .htaccess file as follows 我正在使用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

This is not working for my permalink /%postname% 这不适用于我的永久链接/%postname%

What might be the problem? 可能是什么问题?

1.- Be sure that your set permalinks in Permalink Settings http:// your_domain/wp-admin/options-permalink.php 1.-确保你的固定Permalink Settings http:// your_domain / wp-admin / options-permalink.php

在此输入图像描述

2.- If you are using WP inside a subdir you must modify htaccess: 2.-如果你在子目录中使用WP,你必须修改htaccess:

RewriteBase /subdir/

UPDATE : 更新

3.- enable rewrite module. 3.-启用重写模块。 In ubuntu is easy: 在ubuntu很容易:

sudo a2enmod rewrite

4.- Allow .htaccess in server's config 4.-在服务器配置中允许.htaccess

<Directory /your_wp_dir>
AllowOverride All
</Directory> 

5.- After any change in server's config restart it (again in ubuntu is): 5.-服务器配置中的任何更改重新启动后(再次在ubuntu中):

$ sudo service apache2 restart 

What version of Apache are you using? 您使用的是哪个版本的Apache? Also, make sure you check a test page with 另外,请确保使用检查测试页

<?php
phpinfo();
?>

and CTRL+F for "mod_rewrite". 和CTRL + F表示“mod_rewrite”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM