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 fix duplicate content for homepage and index.html
Hello, I know this probably gets asked quite a lot but I haven't found a recent post about this in 2018 on Moz Q&A, so I thought I would check in and see what the best route/solution for this issue might be. I'm always really worried about making any (potentially bad/wrong) changes to the site, as it's my livelihood, so I'm hoping someone can point me in the right direction. Moz, SEMRush and several other SEO tools are all reporting that I have duplicate content for my homepage and index.html (same identical page). According to Moz, my homepage (without index.html) has PA 29 and index.html has PA 15. They are both showing Status 200. I read that you can either do a 301 redirect or add rel=canonical I currently have a 301 setup for my http to https page and don't have any rel=canonical added to the site/page. What is the best and safest way to get rid of duplicate content and merge the my non index and index.html homepages together these days? I read that both 301 and canonical pass on link juice but I don't know what the best route for me is given what I said above. Thank you for reading, any input is greatly appreciated!
On-Page Optimization | | dreservices0 -
How do i fix my duplicte page issues on Prestashop platform?
I have tried many things such as rel-canonical, duplicate url redirect modules, but still im looking at over 70 duplicate page titles. Most of this is because the same title is used across all the pages and im not sure if this is possible to change. (ex: http://apostolicclothing.com/15-modest-womens-dresses, http://apostolicclothing.com/15-modest-womens-dresses?p=2)
On-Page Optimization | | nathanielleee0 -
How to fix joomla duplicate page titles??
Hello, I have been using seomoz and sh404sef for almost a month now and can't seem to figure out my duplicate page title issue on my joomla site. I have changed everything I thought necessary but no luck. I have one page that I am trying to make dissapear from duplicate page title error and if I can figure it out i'm sure I can use same fix for the other 1,000 duplicate page titles being reported in my seomoz crawl report I have one link that I am working with sef url: http://www.mysite.com/contactus.html I have used sh404sef url manager and added page title, description and keywords to this link and for 3 weeks straight now it still shows that it is duplicate page title in my seomoz crawl report Is there something that I am missing somewhere or did i setup a bad campaign that is looking at wrong things on site? I 've attached image of my sh404sef settings for this link Thanks in advance screenshot1.jpg
On-Page Optimization | | 41global0 -
301 redirects, efficiency and dynamic URLs
Hi, I have 2 301 redirect questions. Question 1: I have am working with a designer on the redesign of a website that currently has over 5,000 indexed pages. The majority of these are dynamic URLs from the Stone Locator database. (see below) http://www.domain.com/storelocator.php?zipcode=91784&page=12 How can I efficiently deal with these pages from an SEO perspective when developing the new site? Is there a way to do a bulk 301 redirect to a store locator page, for instance? Question 2: If a rel=canonical tag has been established on a page (www....), is it necessary to add 301 redirects to all of the other versions on: the home page (domain.com , domain.com/index.html, domain.com/index.html, etc.) all other pages with those same extensions ? Thank you for your help! Erin
On-Page Optimization | | HiddenPeak0 -
Multiple Years Domain Registration
Is there benefit to registering a domain name for multiple years from a SEO standpoint?
On-Page Optimization | | lbohen0 -
Source page leading to a 404 pages in reports
Hi everybody, I wonder how to find and quickly correct 404 errors in my crawl reports : SeoMoz says me "http://domain.com/this-page-is-dead" is 404, but I can't figure out a source page where a link to that url appears. I tried a google link:http://domain.com/this-page-is-dead request, with no more luck. I imagine the trick is trivial, but I need it 🙂 Moreover, why do not show a list of pages referring to this 404 page on reports ? Thanks, Loïc
On-Page Optimization | | mandinga0 -
302 (Temporary Redirect) up and growing, how to fix?
Hi guys. On my website I have an action that will only perform if you are logged into your account, otherwise you are redirected to the login page causing a 302 redirection. When SEOmoz crawls my website, it gets all these redirections to the login page, but I really can't do much better so what is the best way of fixing this? I've thought of using rel="nofollow", but I want make sure this change will fix my issue, both with the SEOmoz crawler and any other search engine crawler. Thank you guys so much!
On-Page Optimization | | tanlup0 -
How long after a URL starts showing a 404 does Google stop crawling?
Before hiring me to do SEO, a client re-launched their site and did not 301 the old URLs to the new. Only the home page URL stayed the same. For a month after the re-launch, the old URLs returned a 404. For the next month, all 404 pages (basically any non-existent URL) were 301'd to the home page. Finally, 2 months after launching, they properly 301'd the old URLs to the new. Now, the new URLs are not ranking well. I assume it's too late to realize any benefit from the 301's, just checking to see if anybody has any insight into how long Google keeps trying to crawl old/404/improperly 301'd URLs. Thanks!
On-Page Optimization | | AndrewMiller0