Home Redirect wordpress URLs containing specific word
Reply: 1

Redirect wordpress URLs containing specific word

webtech
1#
webtech Published in 2018-02-12 17:26:31Z

I have a very specific issue. I want to auto redirect

https://example.com/who-you-are-lyrics/ to
https://example.com/who-you-are/

I have removed the word -lyrics from about 10 000 records in the database, but the problem is that these urls are indexed by Google. So I need to auto redirect the URL containing -lyrics to the url without -lyrics.

Any idea?

mickmackusa
2#
mickmackusa Reply to 2018-02-15 01:06:17Z

You can use:

RedirectMatch ^(.*?)-lyrics/(.*)$ $1/$2

This will only make replacements when there is a match, and the result will exclude the -lyrics substring.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.43647 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO