What are REGEX redirects and How to use?

0
913

What are REGEX Redirects?

REGEX Redirects – redirects more than one source URL to a destination URL of the Website or Blog. It is easiest way to redirect multiple url’s to new destination url by typing 1 single line of regex redirect. If you are Webmaster or Administrator of any website or Blog and looking to redirect more than one source URL to a destination URL then you can use REGEX Redirects.

Normal Redirects works as one source URL to one destination URL but using REGEX you can redirects various source url to one destination without any problem. Just you need to understand the expressions and words contain in URL.

How to use REGEX Redirects?

REGEX redirects is easy to use and anyone can implement on their website. Just all you need is knowledge of Regular Expressions and URL’s want to redirect. We are using Yoast SEO Premium Plugin in WordPress so we will provide you steps below accordingly. But understanding and implementing on other CMS tools wouldn’t be difficult at all.

For Example:

REGEX Redirects

On above screenshot you can see that we are using 2 regex to redirect it to new url.

The first line lets say yourdomaindotcom/rain is the url of your website and want to redirect it to yourdomaindotcom/sunny/, as it would be a normal redirect. However, the same goes for yourdomaindotcom/in-the-rain or yourdomaindotcom/draining. Both would be redirected to yourdomaindotcom/sunny/.

The second line will redirect your all url’s to /sunny-holidays/ if your URL contains /rainy-holidays/ followed by any lowercase character, number or the – and ends with a /.
So /rainy-holiday/london/ would be redirected, while /rainy-holiday/buda+pest/ would not.

Want to know more about regular expressions?

Visit Wikepedia or you can search for tutorials on Google.com

Note: You can break or destroy your website using REGEX redirects if you are inexperience or less knowledge of regular expressions. 

LEAVE A REPLY

Please enter your comment!
Please enter your name here