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
-
Increasing in 404 errors that doesnt exist
Hi First of all I should say that I have error in the old webmaster not the new one. I have two WordPress blog in root and subfolder. Today I checked my webmaster and recognize that I had 100 errors (404) that found in few days ago. My root WordPress is OK but subfolder WordPress has error. Let me show you by example. http://example.com/subfolder/article15245 I had error for this page: http://example.com/article15245 looks like this subfolder deleted I checked my links, but all of them were OK and linked to the right URL. unfortunately this errors dont have "linked from" section
On-Page Optimization | | meysamzare7112365410 -
How can I nofollow my affiliate links?
I have a lot of affiliate links and I need to find an efficient way to nofollow them. I have over 500 blog posts and most have an affiliate link. I use Wordpress and Genesis. Any advice?
On-Page Optimization | | 2bloggers0 -
Dealing with a 404
Hi there, I have an error on one of my campaigns. It says that it gets a 404on this page: http://www.datasat.com/tetra/white-paper.htmlWEhjdAfgkh However, I cannot replicate the above URL as it doesn't exist on the site. The end of the URL has some spurious characters which I don't know how they got there. Has anyone any ideas about what's happening and how I can sort it? Many thanks
On-Page Optimization | | iain0 -
Errors in URL´s
SEOMOZ is showing quite a lot of URL Errors like this: http://trampoliny.net.pl/akcesoria/pokrowiec-basic?frontend=1825cb1eea3af8ee6ee2d96617d32ff6 All these URL´s use the parameter "?frontend=". In webmaster tools we told google not to index this parameter. Unfortunately at the moment we cannot set this parameter as "NOINDEX". We also dont want to use a robots.txt file. How to get rid of the URLS in Seomoz?
On-Page Optimization | | drgoodcat0 -
Can you find the "problem" metric or metrics?
I just dropped from #2 for my main keyword to #5 and am not sure why. My companies Ranking Metrics compared to top 5 Page Authority:#2, MozRank:#1, MozTrust:#1, MT/MR:#1, Total Links: #1, Internal Links:#1, External Links: #1, Followed Links:#1, No Follow Links: #1, Linking Root Domains:#1, OnPageAnalysis Grade: "A", Broad Keyword usage: Yes, Broad keyword in document:
On-Page Optimization | | Boodreaux0 -
301 redirect link
Hi, I found some explanations on seomoz about permanently links, but I'm not sure, if I understood right, what to do. Our website has been created with a wrong structure and I have to change the URL of a couple of pages. E. G. http://www.ix-tours.com/Youth/ixdestBrusselYouth.aspx should be changed to http://www.ix-tours.com/DE/Jugend/BruesselJ.aspx to allow search identify it as a german page. What to do? Should I delete all content from the old page and insert the redirect to the knew one? The code as follows has to be inserted in the head section? Thank you for your help Brgds georg
On-Page Optimization | | itmlage0 -
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 -
Use 301 redirects when deleting old products?
I'm removing old products (wines) from my site, and I've been using 301 redirects for each product page back to the winery page. My question is, am I using best practice? I want people who search for these now nonexistent products to go to the winery page where they will see what is now available. But does google approve? I've also tried leaving the product's page intact but saying that it is no longer available and putting a link in the text that points to the winery page. Which is better, in the eyes of the god google? Thanks!
On-Page Optimization | | JeanYates0