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
-
How To Avoid Redirect Chains When Switching From http to https
I have been working on on-page SEO which has involved switching from http to https, and renaming URLs. I am running in to issues with redirect chains. Here is a scenario: Old URL: http://bwisecontractors.ca/products/decks-and-deck-covers/ New URL: https://bwisecontractors.ca/renos-additions/sunrooms-patio-covers/ Since I already created the redirect addressing the redirecting from http to https for the root domain: (http://bwisecontractors.ca to https://bwisecontractors.ca), should the redirect for the above be http://bwisecontractors.ca/products/decks-and-deck-covers/ to https://bwisecontractors.ca/renos-additions/sunrooms-patio-covers/ , or should it be http://bwisecontractors.ca/products/decks-and-deck-covers/ to http://bwisecontractors.ca/renos-additions/sunrooms-patio-covers/ (and the root domain redirect will take care of going from http to https)
On-Page Optimization | | BWiseContractors0 -
406 http error
Hi I am getting about 10 of these errors and when I click on the link it goes to make login wordpress page can anyone help 406 : Received 406 (Not Acceptable) error response for page http://reseolve.com/wp-login.php?redirect_to=http%3A%2F%2Freseolve.com%2Frecent-posts%2F
On-Page Optimization | | ReSEOlve0 -
Alt Tags on multiple product images
Hi I work on SEO for an ecommerce site and wanted to find out how important it is to optimise all images with alt tags. We have alt tags in place, however have not optimised descriptions for the following example images: Front of cupboard Back of cupboard Side of cupboard etc Is this dangerous for SEO if these images all have the same alt tag? We have thousands of products so it would be a huge job to update these, but if it's crucial for SEO we can work through our priorities. Thank you!
On-Page Optimization | | BeckyKey0 -
Avoid Multiple Page Title Elements...
Hi guys i'm just going trough some pages with the seomoz one page optimization tool. As one of the "easy fix" suggestions it says: "Avoid Multiple Page Title Elements" "Explanation: Web pages are meant to have a single title, and for both accessibility and search engine optimization reasons, we strongly recommend following this practice.Recommendation: Remove all but a single page title element." By single element does it mean 1 single word? Is that realistic?
On-Page Optimization | | Immanuel0 -
How can i change my landing page title in search engines?
Hi SEO folks, Please help! I've changed my home page title 30 days ago, but my Google search results is still showing the old one! Why is that happening? can I've a brief explanation please so i can learn. thanks a million cRnPa6d
On-Page Optimization | | aptustelecom0 -
Why are my tags causing duplicate error?
Hi, When I run an SEO moz crawl it is picking up duplicate errors from my tags. Currently I have these set as domain url/tag/name of the tag. Is this incorrect? Is there anything I can do to stop this being picked up as duplicate pages? Thanks, Eliz
On-Page Optimization | | econley0 -
Can Page Authority of a site be higher than its Domain Authority?
I own a website called Takeyourtips.com. While doing a search no Google, I found that the page authority of the home page (31) is higher than the domain authority (23). I was wondering if it's really possible because my understanding was page authority of a page is determined by its domain authority. Therefore, it the domain authority of a website is 23, none of its page could have a higher page authority. Plus, upon consulting an SEO expert, I was told that neither Domain Authority or Page Authority of a page carries any importance as far as higher ranking of a website is concerned. Is this true? Thanks in advance for the answers. Cheers, Sushant large
On-Page Optimization | | suskanchan0 -
Can you recommend a few resources for Yahoo SEO
We get very little traffic from Yahoo Search and it seems only 15%-20% of our pages are indexed by Yahoo and Bing although we do submit sitemaps to both of them. Do you have some tips or resources (articles, blogs, books) you could recommend for Yahoo Search optimization?
On-Page Optimization | | AEM130