I am trying to redirect traffic from URLs on an old site to a new.
I am using the [[LINK href="https://wordpress.org/plugins/redirection/"]]Redirection[[/LINK]] plugin which works well.
However, on the old website there are 1000s of pages that need redirecting so rather than do each one individually I would like to redirect them to their parent category on the new site based on information within the URL.
Any URL beginning with:
http://evatron.com/index-pag-product-cid-9[rest of URL here]
Needs to redirect to:
So, this URL would be redirected to the category:
The redirection plugin supports regex but my attempts with it so far keep returning a mash up of the two URLs like this:
Can anyone help with right regex to make this happen?
have you tried
as your Source URL?
and Regular expression is checked.
I've attached an image that demonstrate my setup...
you can visit this link to test..
Winner! Perfect thank you.
I had been using ^/index-pag-product-cid-9.*
Now I can set all my redirects up.
Please use Search and Replace plugin, This plugin will do your task in some minutes.
You can use plugin from https://wordpress.org/plugins/search-and-replace/
can you write echo $_SERVER['REQUEST_URI'] on your index.php and share what u get with me?
The URLs I am looking to redirect are not in my database. They are URLs from an older version of the website made up of static html pages.
I need to set 301 redirects from these URLs so we don't lose any search engine traffic while the site being re-indexed by Google.
So unfortunately editing the database wont do it.
We can write an redirect in your index file , so please echo $_SERVER['REQUEST_URI'] and let me know so we can add redirect condition.
i mean to say type http://evatron.com/index-pag-product-cid-9[rest of URL here] in your browser and in index.php write below
I think you are misunderstanding my request.
http://evatron.com/index-pag-product-cid-9..... are URLs from the old version of the website. These pages are now offline. The 301 redirects are to tell search engines they have been moved permanently.
I am after a regex pattern I can place in our Redirection plugin that will direct partial URLs to specific product categories.
My appologise for not understanding your request properly, i will search for pattern and update you