admin管理员组

文章数量:1122832

I have a custom post type "products". I would like to redirect all posts from "products" to one url ex: using htaccess.

For example: , and to be on link click redirected to one page

Options +FollowSymLinks RewriteEngine On RewriteRule ^products/(.*)$ / [R=301,L]

I cant find this topic anywhere. Please help.

I have a custom post type "products". I would like to redirect all posts from "products" to one url ex: http://example.com/page1 using htaccess.

For example: http://example.com/products/post1, http://example.com/products/post2 and http://example.com/products/post3 to be on link click redirected to one page http://example.com/page1

Options +FollowSymLinks RewriteEngine On RewriteRule ^products/(.*)$ /http://example.com/page1 [R=301,L]

I cant find this topic anywhere. Please help.

Share Improve this question asked Mar 2, 2018 at 10:17 dandicarskidandicarski 1
Add a comment  | 

1 Answer 1

Reset to default 0

This answer from Webmaster StackExchange might be helpful:

RewriteRule ^products/ /page1/ [R=301,L]

Goes after the RewriteEngine and RewriteBase rules, but above all the other WordPress stuff.

If you don't want to fiddle with the .htaccess, you can have a look at the Redirection plugin.

本文标签: How to redirect custom post type posts to one url with htaccess