简体   繁体   English

太多的WordPress重定向

[英]Too many wordpress redirects

I've inherited a page with a large multi-step form at /big-form that's passing fields to each subsequent step via POST. 我在/ big-form处继承了一个具有大型多步骤表单的页面,该页面通过POST将字段传递给每个后续步骤。 I need to make each step more SEO friendly, something like /form/step-[1-5]. 我需要使每个步骤对SEO更加友好,例如/ form / step- [1-5]。 It would also have /other-form/step-[1-5] on the same page. 在同一页面上还将具有/ other-form / step- [1-5]。

I added this RewriteRule: 我添加了这个RewriteRule:

RewriteRule ^form/step-[1-5] /big-form/ [QSA,L]

which should push requests for the SEO pages to the already created page, but it 404s. 它应该将对SEO页面的请求推送到已创建的页面,但是会显示404。 Looking through the redirect logs, it's catching the /form/step-1 url, redirecting that to /big-form, then doing the usual wordpress redirects through /index.php. 查看重定向日志,它捕获/ form / step-1网址,将其重定向到/ big-form, 然后通过/index.php进行通常的wordpress重定向。 For some reason, by the time WordPress is looking for what page to render, it's getting confused and giving up. 出于某种原因,当WordPress正在寻找要呈现的页面时,它已经变得混乱和放弃。

Is there a way to redirect all requests from the SEO friendly URLs to the actual page in WordPress? 有没有一种方法可以将所有请求从SEO友好URL重定向到WordPress中的实际页面?

Assuming the site does not contain any other URLs containing "step", you could just do: 假设该站点不包含任何其他包含“ step”的URL,则可以执行以下操作:

RewriteCond %{REQUEST_URI} step RewriteCond%{REQUEST_URI}步骤

RewriteRule .* /big-form/ [R=301] RewriteRule。* / big-form / [R = 301]

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

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