在最新的Woocommerce更新后,我遇到以下问题:
如果我为我的产品添加了一些变体并保存,当我点击产品永久链接时,它会将我重定向到网站的主页。
我使用Custom Post Type插件中的Remove Slug,我的.htacces结构(插件代码)是:
# BEGIN REMOVE SLUG CUSTOM POST TYPE RULES
RewriteRule ^wafp-subscriptions/(.+)/\$ /\$1 [R=301,L]
RewriteRule ^product/(.+)/\$ /\$1 [R=301,L]
RewriteRule ^product_variation/(.+)/\$ /\$1 [R=301,L]
RewriteRule ^/(.+)/\$ /\$1 [R=301,L]
RewriteRule ^shop_order_refund/(.+)/\$ /\$1 [R=301,L]
RewriteRule ^/(.+)/\$ /\$1 [R=301,L]
RewriteRule ^/(.+)/\$ /\$1 [R=301,L]
RewriteRule ^/(.+)/\$ /\$1 [R=301,L]
RewriteRule ^/(.+)/\$ /\$1 [R=301,L]
RewriteRule ^vc_grid_item/(.+)/\$ /\$1 [R=301,L]
RewriteRule ^avada_portfolio/(.+)/\$ /\$1 [R=301,L]
RewriteRule ^avada_faq/(.+)/\$ /\$1 [R=301,L]
RewriteRule ^wpcr3_review/(.+)/\$ /\$1 [R=301,L]
RewriteRule ^fusion_template/(.+)/\$ /\$1 [R=301,L]
RewriteRule ^/(.+)/\$ /\$1 [R=301,L]
# END REMOVE SLUG CUSTOM POST TYPE RULES
我花了一整天时间试图解决这个问题,但我没有找到解决方案。
答案 0 :(得分:0)
@ peter-featherstone调试结果是:
1 RewriteRule ^wafp-subscriptions/(.+)/\$ /\$1 [R=301,L] This rule was not met.
2 RewriteRule ^product/(.+)/\$ /\$1 [R=301,L] This rule was not met.
3 RewriteRule ^product_variation/(.+)/\$ /\$1 [R=301,L] This rule was not met.
4 RewriteRule ^/(.+)/\$ /\$1 [R=301,L] This rule was not met.
5 RewriteRule ^shop_order_refund/(.+)/\$ /\$1 [R=301,L] This rule was not met.
6 RewriteRule ^/(.+)/\$ /\$1 [R=301,L] This rule was not met.
7 RewriteRule ^/(.+)/\$ /\$1 [R=301,L] This rule was not met.
8 RewriteRule ^/(.+)/\$ /\$1 [R=301,L] This rule was not met.
9 RewriteRule ^/(.+)/\$ /\$1 [R=301,L] This rule was not met.
10 RewriteRule ^vc_grid_item/(.+)/\$ /\$1 [R=301,L] This rule was not met.
11 RewriteRule ^avada_portfolio/(.+)/\$ /\$1 [R=301,L] This rule was not met.
12 RewriteRule ^avada_faq/(.+)/\$ /\$1 [R=301,L] This rule was not met.
13 RewriteRule ^wpcr3_review/(.+)/\$ /\$1 [R=301,L] This rule was not met.
14 RewriteRule ^fusion_template/(.+)/\$ /\$1 [R=301,L] This rule was not met.
15 RewriteRule ^/(.+)/\$ /\$1 [R=301,L] This rule was not met.
16 RewriteBase / Using / as the base for the rewrites.
17 RewriteRule ^index\.php$ - [L] This rule was not met.
18 RewriteCond %{REQUEST_FILENAME} !-f This condition was met.
19 RewriteCond %{REQUEST_FILENAME} !-d This condition was met.
20 RewriteRule . /index.php [L] The new url is http://www.sitename.be/index.php
由于RewriteRule选项中的L,测试会停止。