Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 404页面在使用/%category%/%postname%时有效,仅在使用/%postname%时有效_Wordpress_.htaccess_Url_Http Status Code 404_Permalinks - Fatal编程技术网

Wordpress 404页面在使用/%category%/%postname%时有效,仅在使用/%postname%时有效

Wordpress 404页面在使用/%category%/%postname%时有效,仅在使用/%postname%时有效,wordpress,.htaccess,url,http-status-code-404,permalinks,Wordpress,.htaccess,Url,Http Status Code 404,Permalinks,当我将永久链接设置为使用/%category%/%postname%时,我会得到一个404页面,但如果我将其设置为仅使用/%postname%,则效果很好 htaccess设置为mod rewrites等,下面是一个断开的帖子示例: 该网站只创建了2个类别和1个帖子作为测试,以查看该结构是否可行 谢谢 我以前也遇到过这个问题。 仅设置mod rewrites是不够的 我从中找到了。 转到/etc/apache2/sites available/,并在默认文件中进行以下更改 <Direct

当我将永久链接设置为使用/%category%/%postname%时,我会得到一个404页面,但如果我将其设置为仅使用/%postname%,则效果很好

htaccess设置为mod rewrites等,下面是一个断开的帖子示例:

该网站只创建了2个类别和1个帖子作为测试,以查看该结构是否可行


谢谢

我以前也遇到过这个问题。
仅设置mod rewrites是不够的

我从中找到了。
转到
/etc/apache2/sites available/
,并在默认文件中进行以下更改

<Directory /var/www/>
    Options +ExecCGI 
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
</Directory>
<Directory /var/www/blog/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
</Directory>

选项+执行CGI
选项索引跟随符号链接多视图
允许超越所有
命令允许,拒绝
通融
选项索引跟随符号链接多视图
允许超越所有
命令允许,拒绝
通融