我想重定向http://xyz.com/freebooks/ 到http://xyz.com/shop/?min_price=0&max_price=0
我将此添加到。htaccess,它会重定向到商店页面,但不会像原始url那样保留/免费图书/或过滤器。
.htaccees:
RewriteEngine On
RewriteRule ^freebooks$ index.php?p=5&min_price=0&max_price=0 [NC,L]
# 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
结果URL:
xyz.com/shop/
预期URL:xyz.com/freeabooks
(商店只展示免费图书)