AnswerBun.com

How to redirect a page to another?

WordPress Development Asked by heera on September 13, 2020

On my website, I have following url structure:

example.com/test/
example.com/test/a-page
example.com/test/another-page

How can I redirect all of the URLS that contains /test/ right after the domain name to example.com/info/

I understand I can do it using htaccess, but I cannot format the rule syntax.

One Answer

Try the following at the top of your .htaccess file, before the existing WordPress directives:

RewriteRule ^test/ /info/ [R=302,L]

The pattern ^test/ matches all URLs that start /test/.

Note that the URL-path matched by the RewriteRule pattern (first argument) does not start with a slash (when used in .htaccess).

If this is intended to be permanent then change the 302 to 301 - but only after you have tested that it works OK.

Correct answer by MrWhite on September 13, 2020

Add your own answers!

Related Questions

adding existing menu page on new customer user role

1  Asked on November 21, 2021 by neeraj-verma

     

How can I change archive.php posts display?

1  Asked on November 19, 2021 by yjs

 

Change wordpress default upload path to another domain

1  Asked on November 19, 2021 by eni-kazemi

   

WP_QUERY post_in problem

1  Asked on November 19, 2021

   

WordPress posts with multiple fields

2  Asked on November 19, 2021 by dchucks

     

Moving the array pointer inside a WP_Query while loop

1  Asked on November 17, 2021 by anthony-atang

 

get_the_terms error

2  Asked on November 17, 2021 by tkez

     

Check for empty username or password on login

1  Asked on November 17, 2021 by diogo-bento

       

how to add version of style.css in wordpress

11  Asked on November 16, 2021 by toretto

   

301’s not working with multisite

1  Asked on November 16, 2021 by kia4567

   

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP