Regex for removing a substring in URL and changing folder
-
Hi John, thanks for the plugin and introducing me to Regex, even though it’s making me nuts. ??
I had a glossary plugin that had placed the glossary terms in a folder /definiciones and I changed to a different plugin that uses /Lexicon. In the previous plugin, I also used excerpts for each term, which had their own pages. So each term had 2 pages, the term and the excerpt (for a tooltip). They were named “term_name-excerpt”.I got rid of the excerpt pages. Now I want to redirect all the terms to /Lexicon and I want to redirect each excerpt URL to its respective term URL.
I’m using two redirects but it seems to me that I should be able to use one.
here’s what I used to redirect the term:
/definiciones/(.*?)And to redirect the excerpt:
/definiciones/(.*?)\-excerptthey both redirect with:
/Lexicon/$1I learned the \-excerpt from another blogger on your forum who wanted to delete his .html from 700 files, but I don’t really understand how the escape\ works.
Am I right in my suspicion that there should be a way to redirect both with one Regex?
- The topic ‘Regex for removing a substring in URL and changing folder’ is closed to new replies.