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
-
Can service request pages be indexed for a service site?
I think there is no point in indexing service request pages for a service site. And it causes the indexing of the main pages to be done with a delay. Does anyone have experience with indexing service request pages and their results?
On-Page Optimization | | sora.ya04680 -
How to redirect subdomain to new blog directory
I have moved my wordpress blog from a subdomain to a subdirectory /blog/ on my site. What is the best way to setup a redirect from the subdomain to the new /blog/ directory? Or should I just delete the subdomain blog and wait for google to index it on /blog/. I need to do one or the other so as not to run into duplicate content issues.
On-Page Optimization | | SamCUK0 -
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 -
How to evaluate a 404
After my first site crawl im being told that there is a 404 error on my site..... It gives me the problem link url but would it not be useful to show me where its finding this 404 error? How do i find it? it just tells me there is one and the location of the 404 i need to know the page that has the link on it?
On-Page Optimization | | alphatrad0 -
Can someone explain this to me in simple language? Basically what do I have to do?
Accessible to Engines Easy fix <dl> <dt>Crawl status</dt> <dd>Status Code: 200
On-Page Optimization | | Devinder
meta-robots: None
meta-refresh: 0;url=http://akaalpet.com/default.aspx
X-Robots: None</dd> <dt>Explanation</dt> <dd>Pages that can't be crawled or indexed have no opportunity to rank in the results. Before tweaking keyword targeting or leveraging other optimization techniques, it's essential to make sure this page is accessible.</dd> <dt>Recommendation</dt> <dd>Ensure the URL returns the HTTP code 200 and is not blocked with robots.txt, meta robots or x-robots protocol (and does not meta refresh to another URL)</dd> </dl>0 -
Can internal duplicate content cause issues?
Hello all mozzers - has anyone used nitrosell? we use them only because their inventory connects to ours epos point but because they have thousands of 301s on our domain we are getting duplicate content because different sizes of products (we sell womenswear) are creating seperate URLS so we are duplicating both content and URLS - im curious as to whether anyone has experienced simillar problems that have affected their SERPS? Best wishes, Chris
On-Page Optimization | | DaWillow1 -
Can I add a blog to different pages of my site?
I would like to ad a blog to a few different pages of my site, is this possible? I would prefer it to not be a stand alone blog, because I am pretty sure it would begin to outrank my landing pages in search results. I built my site using dreamweaver, but I have seen a reference somewhere to a utility for adding a word press blog to an existing site? This site seems to be doing what I had in mind? http://www.drynclean.com/
On-Page Optimization | | ayetti0 -
How do you fix on page SEO ?
I have been trying to push my foundation website in organic search results for competitive keywords , i have been not been so consistent in raking our website in top search results of Google. can some one recommend the guidelines and activities which can really push my websites to Google first page. More Info: about our foundation We are the worlds largest school meal run ngo in the world feeding over 1.3 million school children in India Wesite url www.akshayapatra.org
On-Page Optimization | | AkshayaPatra0