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.
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
-
Redirect issue
http://www.themorrisagency.co.uk/wedding-band redirects to http://www.themorrisagency.co.uk/wedding-band-cost-much-hire/ NO canonical in place. Nothing in Htaccess. I cant think where else to look to find it. If I amend it to http://www.themorrisagency.co.uk/we it still redirects. Any ideas? I have spent way too long on it now
On-Page Optimization | | agentmorris10 -
Thousands of 404's showing up from Wordpress Blog!?!?
Hey guys, Have recently seen thousands of 404 errors thrown up from my wordpress blog in Google Search Console. These are URL's trying to link (i'm not sure where from) to other parts of my site, but they are not relative to the site root... infact they are a mix of random folders/subfolders and pages on my site. E.g: http://www.MYSITE.co.uk/blog/how-to/driving-to-the-alps/attachment/2013-land-rover-range-rover-evoque-front-snow-1/st-martin-de-belleville/chalet-st-martin-de-belleville/ski-holidays/ski-holidays/summer/st-martin-de-belleville/summer/your-stay-st-martin-de-belleville.html This is a link to a picture on the blog: http://www.MYSITE.co.uk/blog/how-to/driving-to-the-alps/attachment/2013-land-rover-range-rover-evoque-front-snow-1/ And the rest of it is finding it's own way there! Any ideas? This is Wordpress by the way. Cheers, Paul. p.s. I got no help from the Wordpress community so am posting here! p.p.s I forgot to mention that MOZ is reporting these issues too, but running Screaming Frog does NOT show any 404's at all on my site...
On-Page Optimization | | SnowTrippin0 -
How can i improve our TTFB?
Does anyone know about TTFB? Amazon.com TTFB is 50ms. 3dsystems.com TTFB is 109ms. My website TTFB is around 900ms. I have tried to use Amazon CloudFont and change our VPS to a dedicated server. But it still not under 700ms. My website is based on wordpress. How can i improve my TTFB? Could anyone help?
On-Page Optimization | | gordonstyles0 -
How long keep 301 redirects?
Our site has been updated twice in the past 6 years with new, better urls. Initially we did 301 redirects 3 years ago for the url redirects. Recently some of those redirected pages have been redirected again. Question: How long before it's time to have the old, original urls removed through Google? And, once that is done, how long to wait before removing the older redirects from the htaccess file? Appreciate any feedback/insights on this matter.
On-Page Optimization | | Manifestation0 -
Can't figure why ranking dropped after SEO improved.
I took a website that never had any keyword research performed, meta data filled in or anything strategic regarding getting ranked on the search engines. We rebuilt the website from an old Dreamweaver install using Wordpress, did keyword research, optimized one page per keyword term, filled in all the appropriate meta data and alt tags. The site has dropped in rankings and I've been working for the past 3 months to attempt to raise it up. Can you see what I am doing wrong? (This is the client site: http://www.atozqualityfencing.com).
On-Page Optimization | | JanetJ0 -
Should we consider redirecting a high ranking subdomain page to our homepage?
My site bluecotton.com sells custom printed t-shirts. Our DA is 46. Our homepage is PA 55. The design studio is where users create their designs. Over the years the design studio has received a lot of fan fair including links from gizmodo and adobe. When I rank against our biggest competitors customink, ooshirts, uberprints.com I find that our domain as a whole doesn't look all that great. However, when I look at the history of our subdomain I see that we are more trusted and credible than all of our competitors. We have 10k links pointing to the design studio. Here is my question. What if I did 301 redirect of bluecotton.com/studio.html to bluecotton.com? Then I created a new url for the DS. This would not cause users any problems. In fact for many they would get more context around what we are trying to do and what we offer. Is this crazy? I never find results in google for the design studio. It always shows our home. That is pretty much what happens to all of our competitors on the higher traffic terms that are driving real sales. So why do i ask? If my subdomain is more valuable becuase of the design studio links then I wonder if I redirected it to the homepage if it would supercharge my homepage and propel is forward in the serps. Thoughts?
On-Page Optimization | | bradwayland0 -
Schema: Multiple Locations on a Single Page
Can adding multiple locations on a single page be confusing to Google? Is using "LocalBusiness" with "branchof" the proper way of doing this? Does anyone know of any resources that go into this type of thing in more detail? I've read everything Google, Schema and SeoMoz seem to have on this topic. Thanks.
On-Page Optimization | | Kwilder0 -
Canonical Tag for a 404 page
Hi i have a got a 404 page for example : www.example.com/404.aspx can i use canonical tag on this page so that when the search engine hits the page www.example.com/123123123 13123 it will say Will this be right method ?
On-Page Optimization | | usef4u0