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
-
No-return tag error
Am receiving a no-return tag error on Search Console for pages in our site that are unrelated. Originating Page: https://www.eginnovations.com/in-the-news/performance-assurance-a-key-to-virtual-desktop-success Alternate URL: https://www.eginnovations.com/fr/ There is a link to the /fr/ page in the language version at the top of the page but I can't figure out why this would be throwing an error from the originating page. Any help would be appreciated!
On-Page Optimization | | eGInnovations0 -
Htaccess redirect, from /year/month to /blog
I am trying to make some redirects so we don't lose that SEO juice. I am trying to move our blog structure from:
On-Page Optimization | | opiates
http://www.domain.com/2015/09/title-of-blog to:
http://www.domain.com/blog/title-of-blog I need to do redirects in htaccess from the old structure to the new structure but I can't seem to get it working properly. Here is what I have thus far. <code>RewriteEngine on RewriteBase / RewriteRule ^(.0-9)\/^(.0-9)\$ $1/ [R=301,L]</code> Any suggestions?0 -
Getting 404 Errors on Fonts After Website Redesign
Hi, I recently redesigned my website and I changed a few URLs so I have been keeping an eye on 404 errors and setting up redirects as needed. However, my 404 error log keeps getting filled font related URLs like this: <colgroup><col width="960"></colgroup>
On-Page Optimization | | DohenyDrones
| /fonts/AvenirLTStd-Heavy.otf), url(/fonts/AvenirLTStd-Heavy.woff), url(/fonts/AvenirLTStd-Heavy.eot), url(/fonts/AvenirLTStd-Heavy.eot? |
| /fonts/FrutigerLTStd-Black.otf), url(/fonts/FrutigerLTStd-Black.woff), url(/fonts/FrutigerLTStd-Black.eot), url(/fonts/FrutigerLTStd-Black.eot? |
| /fonts/AvenirLTStd-Heavy.otf), url(/fonts/AvenirLTStd-Heavy.woff), url(/fonts/AvenirLTStd-Heavy.eot), url(/fonts/AvenirLTStd-Heavy.eot? |
| /fonts/AvenirLTStd-Book.otf), url(/fonts/AvenirLTStd-Book.woff), url(/fonts/AvenirLTStd-Book.eot), url(/fonts/AvenirLTStd-Book.eot? |
| /fonts/FrutigerLTStd-Bold.otf), url(/fonts/FrutigerLTStd-Bold.woff), url(/fonts/FrutigerLTStd-Bold.eot), url(/fonts/FrutigerLTStd-Bold.eot? |
| /fonts/FrutigerLTStd-Bold.otf), url(/fonts/FrutigerLTStd-Bold.woff), url(/fonts/FrutigerLTStd-Bold.eot), url(/fonts/FrutigerLTStd-Bold.eot? |
| /fonts/FrutigerLTStd-Black.otf), url(/fonts/FrutigerLTStd-Black.woff), url(/fonts/FrutigerLTStd-Black.eot), url(/fonts/FrutigerLTStd-Black.eot? |
| /fonts/AvenirLTStd-Book.otf), url(/fonts/AvenirLTStd-Book.woff), url(/fonts/AvenirLTStd-Book.eot), url(/fonts/AvenirLTStd-Book.eot? |
| /fonts/AvenirLTStd-Heavy.otf), url(/fonts/AvenirLTStd-Heavy.woff), url(/fonts/AvenirLTStd-Heavy.eot), url(/fonts/AvenirLTStd-Heavy.eot? | Any idea what is causing these 404 errors? Is this something that might hurt my SERP?0 -
How many Anchor text i can make on One page.
I would like to have clear answer in numbers i.e. 1, 2, 3, or 4 etc. of how many Anchor text i can make on One page.????
On-Page Optimization | | 1akal0 -
301 Redirect from .html
Hi there, Following on from this post:
On-Page Optimization | | finelinewebsolutions
http://moz.com/community/q/help-with-duplicated-content Please could one confirm that using the following code in our htaccess file will stop the duplicated content issue we are having. RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+.)+html?\ HTTP
RewriteRule (.+).html?$ http://www.bereavementstationery.co.uk/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html Kind Regards Alec0 -
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 Redirect
I am having lot of Temporary Redirect on my reports, and all the links points to my ads server (openX). like this: http://ads.espectador.com/mod2/www/delivery/ck.php?n=a04fb31e&cb=138097 Here in this page there is an example.- How can I fix this? Thanks
On-Page Optimization | | informatica8100 -
On page report card 410 error
I have been trying to test my site through the on page report card using our primary keyword phrase, however, I keep getting the following error message: We were unable to grade that page. The page did not load. Got a 410 response code from server If I try the same search and keyword phrase on other sites, it does work. Am I doing something wrong?
On-Page Optimization | | duesoon0