Redirect 301 & Wild Cards
-
Afternoon All!
Question, I am having trouble getting my head around redirects and I am wondering if someone could help me on this....
We recently changed our website and although were using the same database, were using a different URL structure. So for example...
Old URL siteurl.com/products/product/moredetails/merlin.id1553.html
New URL siteurl.com//vertigo/dl/product.php?p=1553As you can see the product has the same ID number, just in a different directory. What I'd like to happen is....
If you go too siteurl.com////.idXXXX.html then you are 301'd too siteurl.com//vertigo/do/product.php?p=XXXX
Obviously XXXX is the ID number of the product in our database.
Any thoughts? I need help!
Thanks in advance.
-
Excellent! It matches up nicely with the example you provided, and always good to have someone on hand to make sure everything works as intended. Glad you found a good one.
-
Ryan,
You were spot on, hired a chap to do just that. If anyone in the future is interested in the solution it was just this...
RedirectMatch 301 ^(.)/(.)/(.)/(.).id([\d]+).html$ myurl.com/vertigo/dl/product.php?p=$5
-
Hi Richard. This is a fairly complicated redirection scheme you hope to achieve. I'd hire out for a someone skilled in Regex to pull it off smoothly.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
I want to set different price type for India and USA through schema. for eaxmple website is abc.com & there is no cookie/country level redirection.
I am currently working on a website (Ed tech) that is doing business in India as well as USA. The courses are same. Content being served is also same. There is no cookie level redirection. The only difference is in the price range and price type. In schema we have set price type as $. We want to set different price type for India and USA through schema. How can we do this? For example given below website ranks for India & USA with the same domain name but prince range that we can setup either in INR or USA
Technical SEO | | DJ_James0 -
Duplicate content issue with ?utm_source=rss&utm_medium=rss&utm_campaign=
Hello,
Technical SEO | | Dinsh007
Recently, I was checking how my site content is getting indexed in Google and from today I noticed 2 links indexed on google for the same article: This is the proper link - https://techplusgame.com/hideo-kojima-not-interested-in-new-silent-hills-revival-insider-claims/ But why this URL was indexed, I don't know - https://techplusgame.com/hideo-kojima-not-interested-in-new-silent-hills-revival-insider-claims/?utm_source=rss&utm_medium=rss&utm_campaign=hideo-kojima-not-interested-in-new-silent-hills-revival-insider-claims Could you please tell me how to solve this issue? Thank you1 -
Google is still indexing the old domain a year after 301 redirects are put in place
Hi there, You might have experienced this before but for me this is the first. A client of mine moved from domain A (www.domainA.com) to domain B (www.domainB.com). 301 redirects are all in place for over a year. But the old domain is still showing in Google when you search for "site:domainA.com" The HTTP Header check shows this result for the URL https://www.domainA.com/company/cookie-policy.aspx HTTP/1.1 301 Moved Permanently =>
Technical SEO | | iQi
Cache-Control => private
Content-Length => 174
Content-Type => text/html; charset=utf-8
Location => https://www.domain_B_.com/legal/cookie-policy
Server => Microsoft-IIS/10.0
X-AspNetMvc-Version => 5.2
X-AspNet-Version => 4.0.30319
X-Powered-By => ASP.NET
Date => Fri, 15 Mar 2019 12:01:33 GMT
Connection => close Does the redirect look wrong? The change of address request was made on Google Console when the website was moved over a year ago. Edit: Checked the domainA.com on bing and it seems that its not indexed, and replaced with domainB.com, which is the right. Just Google is indexing the old domain! Please let me know your thoughts on why this is happening. Best,0 -
Should I set 301 Redirects or keep old permalinks?
I just built a new site for a client and the new site has pretty links like domain.com/about-us. The old site has been around for a VERY long time and had links like domain.com/aboutus. I want to do 301 redirects because from my understanding, it minimizes the negative SEO impact. But the client wants to keep the permalinks without the hyphens to match the old links. What is the best route, considering SEO? BTW, the site is still on the same domain. Thanks in advance for your help! Neik
Technical SEO | | glassh0use0 -
301 how?
My website is www.photosbykristopher.com, but I have some important links pointing to photosbykristopher.com How do I get my domain without the www to redirect to the domain with the www. PS I use Go daddy for hosting.
Technical SEO | | KristopherWho0 -
301 redirects
Hi, I am a working on a new web site, and I want to redirect all the urls of another site (on a different host) to this one. According to both hosts it is "impossible" to do this for all urls. I don't believe that to be the case, but how do I do this? And, should both sites be hosted on the same server first?
Technical SEO | | vibelingo0 -
Is this a safe 301 redirect?
We are moving our site from one platform to another. Currently on our site we have two homepages. "www.homepage.com" and "www.homepage.com/Index" Both pages have some high quality links pointing in on them. The problem: We are going to be doing a 301 redirect from "www.homepage.com/Index" page to "www.homepage.com" as we are moving platforms at this time we weren't going to create a "www.homepage.com/Index" page all. This leaves this page as an empty URL. With this webpage disappearing all together will we lose traction as we are redirecting an empty URL? Or is it better to recreate this "www.homepage.com/Index" on our new platform redirect it and wait for google to deIndex this page for us? As well is there a tutorial for how to implement 301 redirects or is this something worth looking for a developer and pay someone to do?
Technical SEO | | HCGDiet0 -
301 Redirects Change?
Hi, Mozzers- I've noticed pages that are getting 301 redirected are staying out there longer. It used to be that you would implement a 301 redirect and then after a couple of months the old page would disappear out of Google's index. Over the last couple of months I've noticed pages lingering, popping up.... What gives? Thanks in advance! LHC
Technical SEO | | lhc670