.htaccess Wordpress"太多重定向"错误

时间:2018-01-14 01:12:07

标签: wordpress .htaccess redirect

添加.htaccess重定向后出错。页面收到错误"太多重定向循环"。重定向列表中未提及的页面。没有使用重定向插件。

  • Yoast插件是 在启用/ category选项的情况下安装 - 从URL中删除类别。即使禁用所有插件,错误仍然存​​在。

某些重定向工作正常。

没有运气!所有插件都已禁用 - 仍然无效。我相信它是WP的内置重定向引擎导致问题,但我无法进一步诊断或删除WP 301重定向"缓存/历史记录"。

提前致谢!

https://cyced.co.uk

从以下列表中进行重定向的示例:

https://cyced.co.uk/shropshire

由于以下代码导致重定向循环导致不在列表中的网址示例:

https://cyced.co.uk/blog/cycling-beginners-guide-how-to-start-biking-2018

.htaccess代码完整:

redirect 301 /routes/gloucestershire-route/cheltenham-hillclimb-blitz-two-cycling-route /gloucestershire-cycling-routes
redirect 301 /routes/gloucestershire-route/gloucester-follow-severn-cycling-route /gloucestershire-cycling-routes
redirect 301 /routes/gloucestershire-route/gloucester-steady-cycling-route /gloucestershire-cycling-routes
redirect 301 /routes/gloucestershire-route/gloucestershire-campus-tour-cycling-route /gloucestershire-cycling-routes
redirect 301 /routes/gloucestershire-route/lechlade-cotswolds-cycling-route /gloucestershire-cycling-routes
redirect 301 /routes/gloucestershire-route/stroud-airfield-loop-cycling-route /gloucestershire-cycling-routes
redirect 301 /routes/gloucestershire-route/stroud-cycle-circuit-cycling-route /gloucestershire-cycling-routes
redirect 301 /routes/gloucestershire-route/stroud-newport-cycling-route /gloucestershire-cycling-routes
redirect 301 /routes/gloucestershire-route/forest-dean-newent-woods-cycling-route /gloucestershire-cycling-routes
redirect 301 /routes/gloucestershire-route/forest-dean-st-bravels-cycling-route /gloucestershire-cycling-routes
redirect 301 /routes/gloucestershire-route/cirencester-oxford-cycling-route /gloucestershire-cycling-routes
redirect 301 /routes/gloucestershire-route/cirencester-evesham-cycling-route /gloucestershire-cycling-routes
redirect 301 /routes/gloucestershire-route/cirencester-countryside-loop-cycling-route /gloucestershire-cycling-routes
redirect 301 /routes/gloucestershire-route/chipping-campden-bourton-water-cycling-route /gloucestershire-cycling-routes
redirect 301 /routes/gloucestershire-route/cheltenham-malvern-cycling-route /gloucestershire-cycling-routes
redirect 301 /routes/gloucestershire-route/cheltenham-bourton-water-cycling-route /gloucestershire-cycling-routes
redirect 301 /features/what-are-trail-dogs-and-adventure-dogs /cycling-blog
redirect 301 /shropshire /shropshire-hub
redirect 301 /south-wales /south-wales-hub
redirect 301 /gloucestershire /gloucestershire-hub
redirect 301 /blog /cycling-blog

# 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
# BEGIN WP-HUMMINGBIRD-GZIP

# END WP-HUMMINGBIRD-GZIP
# BEGIN WP-HUMMINGBIRD-CACHING

# END WP-HUMMINGBIRD-CACHING

https configured in WP Dashbboard

  • 网址最近更改​​为/ blog因此重定向。这是通过更新WP仪表板中的类别Slug来完成的。

1 个答案:

答案 0 :(得分:0)

根据您在此处显示的详细信息,我们无法确定,但正如您所看到的,所有内容都运行良好,但博客/ 目录中的内容存在重定向问题。

您应该查看博客/ 目录中 .htaccess 文件中的代码,并查看主文件上是否有任何重定向命令。