How can I fix multiple 404 errors with Wildcard htaccess redirect
-
Hi all I hope that someone can help....
How can I fix multiple 404 errors with Wildcard htaccess redirect
The url in question is:
How can I fix multiple 404 errors with Wildcard htaccess redirect
http://www.5starweddingdirectory.com/listing/location/uk-england/bedfordshire-weddings/franklin-park
http://www.5starweddingdirectory.com/deal/location/uk-england/chorley-weddings/curtis-bay
etc, going to http://www.5starweddingdirectory.com/business
the above is just a few examples, google webmaster is showing over 8.000 404 page not found errors.
Thanks in advance.
-
Hi Denverish, thanks for your reply, been months since i looked at this problem. It has returned so trying to sort it out. the redirects mentioned did not work. so any suggestions.
The CMS allows for 301 redirects via a form; place old url at the top of the form and the new url at the bottom and save,
But as I am trying to create a wildcard 301 redirect, i am not sure what code to place in these fields..see pic
tai
-
Hi Tai, were you able to implement Matt's suggestions?
-
Hi Tai! Any update on this issue? Please let us know so we can help! Thanks.
Christy
-
Hi Matt, sorry for the delay in getting back.
Just working on your suggestions, I will let you know if it works
T
-
Using the redirectmatch directive to redirect the entire deal directory to deals should definitely work for your situation. You then just repeat for each - so for deals:
RedirectMatch 301 /deal/(.*) /deals/$1
-
Hi Matt,
RewriteEngine On
RewriteRule ^listing/(.*)$ http://www.5starweddingdirectory.com/business/ [R=301,L]Did not work,
other urls flagged up in Google WM are/deal/ new: /deals/
http://www.5starweddingdirectory.com/deal/location/uk-england/buckinghamshire-weddings/newport-beach
http://www.5starweddingdirectory.com/deals/
thanks Matt
-
Hi Tai,
I understand what you are saying in regards to making it easier with all the different URLs, however you will need to specify some start point in terms of being one level down from the domain root else you are effectively placing a wildcard on the whole domain, which wouldn't work when you are still working on this domain. So you need to try to identify the few main category URLs such as /listing and so on in order to create a rule.
Did the redirect I give you work for all URLs apart from the one listed? It should have worked for that.
An alternative you can try is:
RewriteEngine On
RewriteRule ^listing/(.*)$ http://www.5starweddingdirectory.com/business/ [R=301,L] -
Hi Matt, thanks again.
Yes we are trying to redirect old urls to the relevant pages.
As we have so many old urls from old cms system which had different url structures, to do a wildcard to catch all 404s would be great. (wordpress plugin wp redirection achieves this http://wordpress.org/plugins/redirection/)
RedirectMatch 301 ^/listing/.*$ http://www.5starweddingdirectory.com/business
But it did not redirect
http://www.5starweddingdirectory.com/listing/location/uk-england/essex-weddings
Thanks for your time on this.
Regards Tai
-
Hi Tai,
I had a look at your site homepage and from your examples I could see you have relative urls which can cause 404 errors and as you mentioned 8000 I thought this could be part of your problems - no domains in your main navigation links so /business rather than www.yourdomain.com/business in coding - so no base URL can cause this. I took one of your links you mentioned to check if your hrefs were relative.
Putting what I mentioned aside for a second do you just want anything that is /listing and /deal redirecting to /business?
Have you tried this for the listing example and repeat for the others such as /deal/:
RedirectMatch 301 ^/listing/.*$ http://www.5starweddingdirectory.com/business
-
Hi Matt, and thank you for your response.
Not sure if i understand the solution to this problem though. The http://www.5starweddingdirectory.com/listing/......./ are from old legacy urls, and we have many. I am not sure why google webmaster is still picking up these old urls. but having 8k old not found urls is a worry.
Regards Tai
-
You can fix this issue much easier than trying to sort out redirects in htaccess. You are coming across this issue because your site uses relative URLs rather than absolute.
Example:
A relative URL isn't tied to a base URL so:
/business
Absolute would be:
www.5starweddingdirectory.com/business
Using relative means that when you visit a page your link is relative to that location so if I was on
www.5starweddingdirectory.com/business and visited the same llink it would become
www.5starweddingdirectory.com/business/business unless redirected.
Having to fix this issue in htaccess can get messy for this and it would be much simpler to change your nav links in the template of your site. I checked this was the case in your sites source code to be certain and you definitely use relative URLs.
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
-
301 Redirect chain
I've got a redirect chain happening
On-Page Optimization | | Libra_Photographic
http > https> https.www. I can't find how to fix this one. My site is on siteground which forces the https at server level and then onto cloudflare. Anyone have any ideas?0 -
Can service request pages be indexed for a service site?
I think there is no point in indexing service request pages for a service site. And it causes the indexing of the main pages to be done with a delay. Does anyone have experience with indexing service request pages and their results?
On-Page Optimization | | sora.ya04680 -
Image scale Error On page seo
I Have an Image Scale Error in Gtmetrix how to solve it which is the best way to solve it I tried many ways but it's not working.
On-Page Optimization | | AlexSmithh0 -
Is this method of redirecting of 404 okay?
Hi all, This is my first post at this forum 🙂 I'am running a Opencart shop with a SEO extension installed. This extension has a redirect module which works like this. When visiting the site on 404 url (and if there is setup a redirect for that url). It serves the correct content but on the 404 url with the correct url set in rel canonical. For example: Try visit this url:
On-Page Optimization | | mrmagnecom
https://makitech.no/ventilasjon/ventilasjons-pakketilbud
Here i have setup a redirect to the correct content, which is actually this url https://makitech.no/pakketilbud I am used to use a 301 header redirect so the user get redirected to the correct url. So my question is this. Is it a okay practice to serve the content on the 404 url (it responds 200) when the correct url is set in canonical? Any thoughts?0 -
Duplicate Meta Tag error
I am getting Duplicate Meta tag error(under HTML improvement) for these kinds of pages http://www.gobol.in/catalogsearch/result/index/?category=&p=3&q=sharp+split+AC+1.5+ton&x=0&y=0 http://www.gobol.in/catalogsearch/result/index/?category=&q=sharp+split+AC+1.5+ton&special_price=4%2C10000&x=0&y=0 http://www.gobol.in/catalogsearch/result/index/?category=&q=sharp+split+AC+1.5+ton&special_price=5%2C10000_8%2C10000&x=0&y=0 What is the best way to resolve such type of error?
On-Page Optimization | | Obbserv0 -
Looking for a few hours of consult from an on-page/redirection SEO guru.
Hi! I could post our question here, but I think we will need an hour or so of questions and answers. Anyone consider themselves an on-page guru or redirection strategy guru? Here is the breakdown: 1. We sell digital media. 2. Most of the pages that return for us in the serps are indexed Search Results pages. From the research we have done, these are our highest trafficked results, but also our lowest converters. We have hundreds of thousands of indexed and dynamic Search Result pages we need to deal with. 3. We are concerned about Panda eventually giving us issues with these indexed Search Pages. 4. We would like to 301 re-direct these indexed Search Results pages to applicable product pages. 5. Looking for advice on a strategy to do so which would include the best way to locate the pages we need to 301 in the SERPS, being careful that the 301 will help and not harm us, etc. Note, we are just looking for a couple of hours of discussion and guidance. We don't need a massive SEO analysis or anything. Just looking for input and guidance on this one particular issue. If you just want to answer here for free, hey, we won't complain, but are happy to pay for quality advice. PM if interested. Thanks! Craig
On-Page Optimization | | TheCraig0 -
Can you set objectives for an SEO campaign?
We have been working with a client for 3 months and they've been happy with the progress we've made on their SEO and the resulting increase in rankings, traffic etc. They are renewing their contract for another 6 months but this time want to set some objectives and want us to suggest what those objectives are. Is it possible to set objectives when a great deal of the results can be out of our hands, eg, how Google works, level of interest in the client's products in the target market, whether they take on board our recommendations for changing their website content to get better seo results etc? What would other people be happy being set as their objectives for a campaign?
On-Page Optimization | | mfrgolfgti0 -
Can Anyone Explain Ranking Drop?!?
Good Morning, I'm hoping someone out there can try and help me figure out what has caused my site to drop from #6 to #10 to #14 and now #19 for my main keyword.. ( My Site is : http://goo.gl/JgK1e ) I am convinced that my site has the best/most unique content in this niche. Every other site uses the same manufacturer descriptions and info and i have added text to certain pages to try and give them more unique content. I believe that my site is very easy to use and navigate, and should be considered a great user experience... Any guidance or help would be greatly appreciated.... Thanks
On-Page Optimization | | Prime850