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
Wordpress Post/Pages在使用永久链接时重定向,而在使用默认设置时不重定向_Wordpress_Post_Redirect_Setting - Fatal编程技术网

Wordpress Post/Pages在使用永久链接时重定向,而在使用默认设置时不重定向

Wordpress Post/Pages在使用永久链接时重定向,而在使用默认设置时不重定向,wordpress,post,redirect,setting,Wordpress,Post,Redirect,Setting,我有一个webiste,在上面我使用了永久链接,比如/%category%/%postname%/ 一两周前他们工作得很好。现在,当我想进入一个页面时,会出现一个错误,告诉我该页面没有正确重定向 我的htaccess文件中没有重定向。没有一个 如果我将永久链接更改为默认值,那么每个页面/帖子都可以正常工作 我不知道该怎么办。请帮忙 这是.htaccess <ifModule mod_headers.c> ExpiresActive On # Expires after 1 m

我有一个webiste,在上面我使用了永久链接,比如/%category%/%postname%/

一两周前他们工作得很好。现在,当我想进入一个页面时,会出现一个错误,告诉我该页面没有正确重定向

我的htaccess文件中没有重定向。没有一个 如果我将永久链接更改为默认值,那么每个页面/帖子都可以正常工作

我不知道该怎么办。请帮忙

这是.htaccess

<ifModule mod_headers.c>
  ExpiresActive On
  # Expires after 1 month
  <filesMatch ".(gif|png|jpg|jpeg|ico|pdf|js|htm|html|txt)$">
    Header set Cache-Control "max-age=2592000"
  </filesMatch>
  # Expires after 1 day
  <filesMatch ".(css)$">
    Header set Cache-Control "max-age=2592000"
  </filesMatch>
</ifModule>
# BEGIN W3TC Browser Cache
<IfModule mod_deflate.c>
    <IfModule mod_headers.c>
        Header append Vary User-Agent env=!dont-vary
    </IfModule>
        AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
    <IfModule mod_mime.c>
        # DEFLATE by extension
        AddOutputFilter DEFLATE js css htm html xml
    </IfModule>
</IfModule>
# END W3TC Browser Cache
# 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

过期于
#1个月后到期
标题集缓存控制“最大年龄=2592000”
#1天后到期
标题集缓存控制“最大年龄=2592000”
#开始W3TC浏览器缓存
标头附加变量用户代理env=!不要改变
AddOutputFilterByType DEFLATE text/css text/x-component应用程序/x-javascript应用程序/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon应用程序/json
#扩展放气
AddOutputFilter DEFLATE js css htm html xml
#结束W3TC浏览器缓存
#开始WordPress
重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
#结束WordPress

修复wordpress重定向问题的非常通用的方法:(在所有情况下都应该有效)

  • /wp admin/options-permalink.php单击“保存更改”。这将刷新WP重定向规则
  • 检查.htaccess,尝试注释除WP部分以外的所有内容
  • 尝试临时禁用插件。快速的方法是重命名wp内容/插件/文件夹,wp不会禁用插件,只是不会加载它们。注意:当wp-content/plugins/被重命名时,不要访问/wp-admin/plugins.php,因为wp会自动禁用它们
  • 检查主题文件functions.php,尝试激活另一个/默认主题进行测试
  • 如果上述方法无效,请下载新的WP版本
    提示:尽量不要更改wp admin/或wp includes/文件夹中的文件。这些都会给未来带来灾难。

    请编辑您的问题,并将您现在拥有的所有内容放入。htaccess我已经用htaccess代码更新了问题。您收到的错误消息是什么?错误页?空白页?如果您临时禁用W3TC,永久链接会工作吗?为什么我要禁用W3TC?我做了任何事,但仍然一事无成。我已经删除了所有的chace并停用了,什么都没有。这只是一个测试,看看W3TC.htaccess代码是否是根本原因。如果不是的话,那就在别的地方。那错误信息呢?