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
-
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 -
Duplicate products - is this fix acceptable?
Hey Mozzers, Questions around this have been asked time and time again. But i have a specific example I would like some advice on. I have 2 products, Product 1: https://goo.gl/Gzo1WC
On-Page Optimization | | ATP
Product 2: https://goo.gl/VbrHQJ As you can see, the products are almost identical bar some technical specifications. The owner of the business wants them listing as 2 products, combining them into a single listing with configurable options is not an option. As such I have simply made one a canonical of the other. Whilst not ideal this seems to be the best "SEO" fix. Option 2: My second option is to rewrite the descriptions to they are different - not too hard on this product and a future options when i have more time, however.... I am presented with a similar problem for another product where there are 23 versions of the same product, i cannot rewrite the same info this many times. They are different sizes, ranges, capacities, resolutions and accuracies and must be listed separately but contain all the same features and basic product information. The basic info is too important not to talk about, and talking about all the technical specs would be too much and teaching the customers likely to buy them to suck eggs. As such I have taken the 23 products and broken them down into 5 similar groups of 2 to 6 products. I have then picked 1 product from each group and written a unique description and changed all similar products in its group to match choosing 1product in each group as the canonical for all the others. So 23 same products become 5 unique products with 18 duplicated products pointing to them as canonicals. Any product pointing to another only differs in technical info, 95% of the page is the same. Whilst obviously not ideal, Is this an acceptable use of canonicals?0 -
What Next after Weekly Crawl Errors Fixed?
Hi MoZ Community! Moz weekly crawl used to report following errors : I have fixed them all over the time. Can somebody give an idea what to do next with the help of Moz or away from Moz to improve my optimization practices. I believe this is just start of the SEO. Or how is it if I focus link building efforts and start fighting for keywords. Also any suggestions about the web? Tanveer | Duplicate Page Content 4XX (Client Error) Title Missing or Empty 5XX (Server Error) Missing Meta Description Tag Duplicate Page Title Title Element Too Long (> 70 Characters) Title Element Too Short Meta Refresh Temporary Redirect |
On-Page Optimization | | Sequelmed0 -
Can i use H2 tag for a brand logo
I want to use the brand logo of my products as a H2 tag and use ALT attribute for the image. Please refer for example to: http://www.parfumerie.nl/zoek-op-merk/clarins/clarinsmen/anti-huidveroudering/clarins-men-gel-revitalisant-50-ml/ CODE Clarins Online Is this ok for my SEO or do you advice me to no use the H2 tag for this?
On-Page Optimization | | parfumerienl0 -
Can I add a paragraph of blog content to a product page?
I have a great blog post about one of my products, which means there's some copy in the blog that I would like in the product page. It would constitute perhaps 5% of the copy on the product page if I copied it.
On-Page Optimization | | Brocberry0 -
Hi.. Can a E-commerce site have a Google Authorship.
Hi Can a E-commerce site have a Google Authorship, and if yes i have learned google requires a face for Google Authorship, as they are applying Facial recognition with the authorship. If So, how can an e-commerce website have an individual's face. ?
On-Page Optimization | | usef4u0 -
Temporary Redirects
On my crawl report from SEOmoz, I have a lot of Temporary Redirects listed. The referring site is a product category page, but the URL listed is part of a shopping cart. For example: | http://www.adagiowaterfeatures.com/cart.php?action=add&product_id=496 | Tested true for a temporary redirect referred by this url: | http://www.adagiowaterfeatures.com/categories.php?category=Free-Standing-Water-Features/Harmony-River-Collection | Why does this occur and what can I do about it?
On-Page Optimization | | AdagioWaterFeatures0 -
SEOmoz crawl error
Hi, I'm getting a crawl error and it complains about there being missing meta description... But, the errors are all for non existent index files in directories that only contain pdf files and some thumbs of the front page... Just started trying to learn this stuff...! Cheers Rod
On-Page Optimization | | DrWho0