How to redirect a page to another?

WordPress Development Asked by heera on September 13, 2020

On my website, I have following url structure:

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

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

Exclude category from shortcode

2  Asked on February 26, 2021 by sot


get_query_var to get second slash parameters

0  Asked on February 26, 2021 by v2mpire-20202


tax_query will produce nothing

1  Asked on February 25, 2021 by cain-nuke


Updating custom fields with external data

2  Asked on February 24, 2021 by hal-atkins


get_terms based on post meta value

0  Asked on February 22, 2021 by traummaschine


Sudden email notifications for new users and password changes

0  Asked on February 21, 2021 by jessica-mele


Breadcrumb – Getting Nav Menu Items

0  Asked on February 18, 2021 by valeron


Question about repurposing WordPress 404 handler

1  Asked on February 18, 2021 by yvan-gagnon


Set post comments open function

3  Asked on February 17, 2021


Woocommerce Filter orders by shipping method

0  Asked on February 16, 2021 by ssslippy


Make custom post type column sortable

2  Asked on February 15, 2021 by leemon


How can I configure an SMTP Server?

1  Asked on February 11, 2021 by ellen


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP