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 I replace categories with a static page
Hello there. I want to replace all of WordPress categories with static pages so that users see a well designed and constructed presentation of all the articles within each topic instead of just a long list of excerpts. I've already done this with 2 categories and although it is hard work I can't help feeling it is a much better thing for my users. However, I'm concerned that I am embarking on this project without being totally sure that it makes sense from an Seo point of view, or whether there are any downsides I haven't thought of? My idea is that the WordPress categories are set to noindex and nofollow. Search engines should find all of my static category pages and all of the content within each category will be spidered from there instead. Just to be sure you know what I mean here is a link to a normal category - https://www.whitegoodshelp.co.uk/category/consumer/ and here is my static page replacement for it - https://www.whitegoodshelp.co.uk/consumer-rights-appliances/ Both pages contain links to all articles within the category except the one generated by WordPress is just a long paginated list, and my replacement is a proper category page, which is hopefully far more useful . Can someone please confirm that there are no downsides to this strategy? 🙂
On-Page Optimization | | Snowdune1 -
Can I reuse meta description tag on another site?
Hi....lets say i sell widgets and on my site i have redWidgets, blueWidgets and greenWidgets. Each of these widget page's has a meta description tag that seems to help click through. I now have a different site that would like to do a right up about each widget and will dedicate a independent page to each widget. Can i safely provide them with the original meta descriptions (from my original site) for each widget i have on my site to then use on these "right up" pages (as they seem to work well and are informative of the subject matter). I am not sure if this is a seo issue or not. I would think not but would appreciate any input. thank you
On-Page Optimization | | nomad-2023230 -
Product names are defacto identical - How can I modify Title?
Hi! Our site http://www.metecoparts.gr/ help our customers search our inventory of cars for used parts. The way the titles of product pages are structured is: Car Parts – Make Model Year – Brand Name. So for instance this page http://www.metecoparts.gr/car/4074-alfa-romeo-156-1997 have the title "Car Parts Alfa Romeo 156 1997 – Meteco SA" (I have translated Greek words to English) So as you can imagine we end up with a bunch of duplicate titles pages. I’m trying to diversify the titles but the problem is that there aren’t many product identifiers other than body configuration, car color, fuel, engine capacity and engine code. But only color and year of production is partly unique as most Alfa Romeo 156 are 4 door saloons, with 1600cc petrol engine. The only thing that is unique for every product page is the page ID. So should I use it in the page title? Its the only unique identificator but on ther other hand it has no use for our customers. Or is there any other way of having unique titles that I am missing? Please note that in our industry on-page optimization is crucial since there is no social sharing and much link building (who wants to share an old car that is being sold for parts?) Thank you
On-Page Optimization | | Johnlock10 -
Is there some reputed company/person which can fix the SEO issues for me?
One of my websites http://forum32.com/ was ruling the roost shortly after it launched. We cover BTS (behind the scenes) etc of the TV shows that my production company makes. But then it all went downhill. I do understand that my readership fluctuates with the number of shows I am doing and therefore covering but for a show like "Qubool Hai" which has been running for the past 3 years and we do almost two posts about it - we rank nowhere. Could posting about this "too much" be a problem? Anyway I have been breaking my head over this for the past six months and spent a lot of time trying to set this right but: 1. I am running out of time as I am about to start directing another show. 2. I am not even sure if what I am doing is right! Can any person/company Which is well trusted help me out of this situation? Here is a screenshot of my latest report from MOZ: https://infinit.io/_/jPcUTJP
On-Page Optimization | | gmaxstudios0 -
Can you help with quality and interesting content ideas?
Hi I'm ranking for "online biology degree" and "online wildlife biology degree" but I have bad content and I receive almost 100% bounce rate. Can you help me with ideas on good content and interesting information I can provide for people looking for "online wildlife biology degree" and "online biology courses" "biology degree online" Every idea would be appreciated. Yoseph
On-Page Optimization | | Joseph-Green-SEO0 -
Is is ok to have multiple H2 or H3s?
Hi mozzers, I am wondering if the search engine gets bothered to read multiple heading 2s or heading 3s or heading4s (these would be unique content headings of course)? I am asking this because I need to follow a consistent content structure and many of titles would fall into one type of headings. Thanks Ty
On-Page Optimization | | Ideas-Money-Art7 -
Multiple Translations on a Wordpress Blog
Hi, If I wanted to have multiple translations available on the following wordpress blog: Packageforwardingservice.com. What would be the best strategy? Use a plugin or use a subdomain such as spanish.packageforwardingservice.com? If the second option how would I add the translated content? install another version of wordpress on host? Thanks!
On-Page Optimization | | MasonInteractive0 -
Redirecting a Parked Domain
A client's friend has had a parked domain for over 11 years. He has done nothing with it but throw a couple of ads on it. It has some traffic, most likely from typos: the domain domain is somewhat similar to a leading search engine. But the parked domain has no content, no links, no DA. I can't see the benefit of the redirect. My client might get a little traffic -- but the parked domain has nothing to do with his niche. Am I missing something? Is there any risk involved in the redirect (beyond unqualified traffic that isn't valuable?)
On-Page Optimization | | DanielFreedman0