Want to create 410 error for some limited folders - htaccess or some other method

Need help with the Administration of your Joomla! 3.x site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
tofty
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Dec 14, 2016 4:56 am

Want to create 410 error for some limited folders - htaccess or some other method

Post by tofty » Tue Nov 26, 2019 10:04 pm

I want to put a 410 error code on all articles under 2 folders. I think I need to do that in the .htaccess file. But I'm not a coder, so I don't know how to create the correct syntax, or even if that's the right way to do it. I don't want 404 errors for these pages. If possible, I want to simply deliver the existing 404 page. I do want the error to be 410 but I have no need to have a custom page, the existing error page is just fine. But I don't even know where that is and how to reference it properly.

The urls look like this (they normally have https:// in front, but I don't really need them to be clickable here):
feastforfreedom.com/ingredient
feastforfreedom.com/ingredient/
feastforfreedom.com/ingredient/item/67-beans-legumes-nuts-seeds
feastforfreedom.com/ingredient/items/7-types
feastforfreedom.com/ingredients
feastforfreedom.com/ingredients/
feastforfreedom.com/ingredients/item/23-10003-10054-almonds
feastforfreedom.com/ingredients/category-items/3-single/type-13/91-beans-legumes-nuts-seeds
... etc.

I am running the following:
Joomla 3.9.13
Gantry 5.4.31 with Helium 5.4.31
Cobalt 8.773

 
User avatar
AMurray
Joomla! Champion
Joomla! Champion
Posts: 5641
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Want to create 410 error for some limited folders - htaccess or some other method

Post by AMurray » Wed Nov 27, 2019 8:57 am

First I need to ask why can't you just redirect those pages (are they no longer valid?)

If they are removed (i.e. menu items, and articles deleted) you won't be able to navigate to them, search engine references to those files will result in 404's. Eventually the dead links will drop-off search engine results.

This may give a clue how to do the 410 in .htaccess.... https://webmasters.stackexchange.com/qu ... ter-is-pre
Regards,
--------------------------------------------------------------
A Murray
Millennium Falcon - it's the ship that made the Kessel run in less than 12 parsecs! The fastest hunk of junk in the galaxy.

User avatar
leolam
Joomla! Master
Joomla! Master
Posts: 20039
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ UK/ S'pore/Jakarta/ North America
Contact:

Re: Want to create 410 error for some limited folders - htaccess or some other method

Post by leolam » Fri Nov 29, 2019 7:02 pm

Error 410 means that the resource is no longer available. So if that is the case why not just remove the links?

Leo 8)
Joomla's #1 Professional Services Provider:
-> Joomla Professional Support: https://gws-desk.com -
-> Joomla Specialized Hosting Solutions: https://gws-host.com -
-> Joomla Webmaster Services: gws-webmaster.services

User avatar
sozzled
Joomla! Exemplar
Joomla! Exemplar
Posts: 8948
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia
Contact:

Re: Want to create 410 error for some limited folders - htaccess or some other method

Post by sozzled » Fri Nov 29, 2019 7:17 pm

I agree with Leo. Why do this?

tofty wrote:
Tue Nov 26, 2019 10:04 pm
I want to put a 410 error code on all articles under 2 folders.
As a normal, everyday user of the internet, I don't like to waste my time when I visit a website. As we all know, the average user "attention span" is about two seconds. If you don't find what you're looking for in the first two seconds then people just leave ... and they may not even come back.

So, I'm just saying, that if someone visits a website and they search or click something and the result is an error condition (and I mean any error condition) you might as well kiss them good-bye. I don't like any page(s) of any of my websites to have errors: I'm not saying that because I'm a "perfectionist"; I'm saying this because I know how I would react if I was a visitor to my websites and I encountered an error. Error messages/codes are things we should try to avoid where possible.

There are good uses for error codes. For example, suppose someone wanted to search for the word "ingredient" and they mis-typed the word "ingerdient", then it would be quite acceptable to say "Sorry, no results matched that search term", wouldn't it? In that case, it's not the fault of the website; the problem was caused by the end-user's clumsy fingers. ;)
https://www.kuneze.com/blog
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

tofty
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Dec 14, 2016 4:56 am

Re: Want to create 410 error for some limited folders - htaccess or some other method

Post by tofty » Fri Nov 29, 2019 7:48 pm

It's actually the search engines that I need to quit sending people to these pages (google). I plan on removing all these pages. The amount of traffic coming is very small. No site visitor coming in on other pages is visiting these pages. No one landing on these pages is using the rest of my site. The only reason I'm getting people land on these pages is because there are terms that are very difficult to find on the internet. They are about food additives. But now the focus of my site is on recipes and I don't want to cover topics about food additives any more.

I need to distance myself from the topics that are on these pages, as google is penalizing people who are critical of Big Food. The best way to do that is to put a 410 error on these pages, and they will quickly disappear as topics on my site in the eyes of search engines. With only a 404 error, it could take months before search engines remove the link to these terms from my site.

As for not wanting errors on pages, that's why I have not yet taken them down. I will take them down, put a 410 error code in place, update my site map, and update Google search console with the new site map all at the same time. Then these pages will quickly no longer be served to searchers on Google.

I do still need to know how to reference the error page to deliver the correct error page. How do I reference that in Joomla with Gantry? I'll go to Stackexchange to figure out all the correct syntax, but I need to figure out where the error page is on my site.

User avatar
sozzled
Joomla! Exemplar
Joomla! Exemplar
Posts: 8948
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia
Contact:

Re: Want to create 410 error for some limited folders - htaccess or some other method

Post by sozzled » Fri Nov 29, 2019 8:08 pm

Thank you for your reply. I understand your concerns. The problem is not really about J! or about whether you use "error codes": the problem is about what SERPs people use to access your website. That's an entirely different question, of course. You can solve those matters but I am only concerned here with the question of using error codes as a solution.

tofty wrote:
Fri Nov 29, 2019 7:48 pm
The best way to [address issues caused by outdated SERPs] is to put a 410 error on these pages, and they will quickly disappear as topics on my site in the eyes of search engines. With only a 404 error, it could take months before search engines remove the link to these terms from my site.
As I wrote just now, there are other ways to address those matters but, in my opinion, I don't think that using 410s is the most effective solution to the problem.

Perhaps it's because we move in different circles: you're involved with "big food" content and I'm not. So this is not something that I have to contend with. However, there are a couple of ways to look at the problem: (a) look at the problem from a search-engine perspective and deal with it by "explaining" to Google what you want done, or (b) look at the problem from the end-user perspective.

From the end-user perspective, 410s are horrible. I have no comment about using 410s with Google because I've never used error codes to tell Google to remove URLs from the search index. In summary, I'm not trying to dispute what you think is "the best way" to address the Google problem but I'm saying that there are other ways to address Google's "concerns". OK? :)
https://www.kuneze.com/blog
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

tofty
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Dec 14, 2016 4:56 am

Re: Want to create 410 error for some limited folders - htaccess or some other method

Post by tofty » Fri Nov 29, 2019 8:29 pm

I'm not sure what other solutions there are to address Google's concerns. I need to stop the words in some of the urls from even being associated with my site. 410's will tell them exactly that and they'll quit linking to my site for these words. If google quits serving these pages, there will be no humans getting error pages. And even if there was, these visitors don't want recipes - they want info on food additive chemicals.

I have had a recommendation from an SEO specialist within the food blogger community state that 410 errors are the best solution when pages are removed and there is no suitable redirection page. It communicates it quickly to search engines to remove my site from those specific search results. I can see exactly what terms are sending traffic to these pages, and it's only a very small number of words, that exist nowhere else on my site. So I won't be losing legitimate traffic. My site is not very popular, so it's not a big deal if I lose a tiny bit of traffic. But I suspect having these topics on my site is hurting me, so if I remove them, the hope is that I will stop being penalized for having them.

If I had WordPress, there are plugins to do this, but I haven't found a plugin for Joomla to do this. That's why I'm looking on how to do it via .htaccess. I don't have a developer to do it either, so I just have to figure it out.

User avatar
sozzled
Joomla! Exemplar
Joomla! Exemplar
Posts: 8948
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia
Contact:

Re: Want to create 410 error for some limited folders - htaccess or some other method

Post by sozzled » Fri Nov 29, 2019 9:12 pm

OK. Even though Leo and I are in agreement that 410s are probably not an effective solution, I won't argue with the OP. See @AMurray's reply (msg #2 in this discussion) for how to redirect URLs so that they generate error code 410. If that works for you then that's a good outcome. Good luck. 8)
https://www.kuneze.com/blog
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

tofty
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Dec 14, 2016 4:56 am

Re: Want to create 410 error for some limited folders - htaccess or some other method

Post by tofty » Fri Nov 29, 2019 9:33 pm

If you have some other solution besides a 410 or 404 error, please let me know what they are.

User avatar
sozzled
Joomla! Exemplar
Joomla! Exemplar
Posts: 8948
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia
Contact:

Re: Want to create 410 error for some limited folders - htaccess or some other method

Post by sozzled » Fri Nov 29, 2019 9:56 pm

I don't want to confuse you. If your SEO expert told you that the best way is to use 410s then please don't take my advice. As I say, good luck. :)
https://www.kuneze.com/blog
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

 

Post Reply

Return to “Administration Joomla! 3.x”