简体   繁体   English

删除子目录并重定向301

[英]Remove subdirectory and redirect 301

I use Wordpress, WooCommerce and MailChimp plugin, I think there's issue about MailChimp plugin. 我使用Wordpress,WooCommerce和MailChimp插件,我认为MailChimp插件存在问题。

I found on Search Console a lot of 404 error, links like this: 我在Search Console上发现了很多404错误,链接如下:

/product-name/15df4gdfg4d5g4d56f /产品名称/ 15df4gdfg4d5g4d56f

How can remove: 15df4gdfg4d5g4d56f 如何删除:15df4gdfg4d5g4d56f

and write redirect on: /product-name/ ? 并在/ product-name /上写重定向

I think I need a rule because there are a lot 404 error 我认为我需要一条规则,因为有很多404错误

Thanks in advance 提前致谢

The simplest solution is to would use the Redirection plugin. 最简单的解决方案是使用重定向插件。 It allows you to create Regex rules so that anything that matches /product-name/* redirects to /product-name/ . 它允许您创建正则表达式规则,以便与/product-name/*匹配的任何内容都重定向到/product-name/ Otherwise, you'd have to manually write rules to your .htaccess file. 否则,您将必须手动将规则写入.htaccess文件。

The Redirection plugin also catches any 404s and allows you to create redirection rules based on those 404 errors. 重定向插件还可以捕获所有404,并允许您基于这些404错误创建重定向规则。

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

相关问题 301将子目录中的文件重定向到子目录根目录 - 301 Redirect files within subdirectory to the subdirectory root 301将子目录中的旧网址重定向到新网址 - 301 redirect old urls in subdirectory to new urls WordPress 301重定向子目录并保持猜测网址 - Wordpress 301 redirect subdirectory with keeping guessing URL htaccess 301重定向子目录更深一层 - 为什么这不起作用? - htaccess 301 redirect subdirectory one level deeper - why is this not working? Htaccess 301从一个目录重定向到其子目录并保持主目录url可访问 - Htaccess 301 redirect from one directory to its subdirectory and keeping the main directory url accesible 使用301重定向和htaccess中的其他页面将Wordpress博客从子目录移动到根目录 - Moving Wordpress blog from subdirectory to root with 301 Redirect, and with other pages in htaccess .htaccess 301从一个子目录重定向到另一个子目录并保留文件夹/目录结构 - .htaccess 301 redirect from one subdirectory to another and preserve folder/directory structure 将.htaccess更改为301重定向,并从URL删除通配符类别 - Change .htaccess to 301 Redirect and REMOVE wildcard category from URL 如何 301 重定向特定页面以删除部分 URL? - How do I 301 redirect specific pages to remove part of the URL? 从 301 重定向 mod_rewrite 中删除 %2F - Remove %2F from 301 Redirect mod_rewrite
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM