admin管理员组

文章数量:1290971

I have URL-friendly filtering plugin enabled (WP Grid Builder) and I want to utilise this for the category archive page.

I want to redirect an archive page / to /?_tag_thoughts=branding with tag_thoughts being the Facet's name and =branding being the category. Note: those are real working URLs.

I don't mind using a redirection plugin or even a custom PHP redirection code. Any help is appreciated.

I have URL-friendly filtering plugin enabled (WP Grid Builder) and I want to utilise this for the category archive page.

I want to redirect an archive page https://tag.alfian.co/blog/category/branding/ to https://tag.alfian.co/blog/?_tag_thoughts=branding with tag_thoughts being the Facet's name and =branding being the category. Note: those are real working URLs.

I don't mind using a redirection plugin or even a custom PHP redirection code. Any help is appreciated.

Share Improve this question asked Jun 9, 2021 at 4:45 aahlfeeyannaahlfeeyann 11 bronze badge 1
  • The plugin Redirection is good for this kind of thing if you don't want to use code. wordpress/plugins/redirection – Michelle Commented Jun 9, 2021 at 18:54
Add a comment  | 

1 Answer 1

Reset to default 0

Welcome aboard,

This should be made with the PHP rewrite rule in WordPress functions, but if you don't want to use PHP, you can use the .htaccess redirection.

RewriteRule ^blog/category/(.*)$ /blog/?_tag_thoughts=$1 [R=301,NC,L]

Change WordPress .htaccess code with code below

# BEGIN WordPress

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule ^blog/category/(.*)$ /blog/?_tag_thoughts=$1 [R=301,NC,L]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

本文标签: filtersRedirect an archive page to its relevant URLfriendly filtered page