Keyword

Soft404

  • Steven Roberts
  • Steven Roberts's Avatar Topic Author
  • Offline
  • New Member
More
6 years 11 months ago #165696 by Steven Roberts
Soft404 was created by Steven Roberts
Recently my Joomla site that uses K2 started getting a lot of "Soft404" errors. The URLs look like
/?option=com_k2&view=itemlist&task=user&id=xxx

where xxx is a random number. The referrer in these cases is my own website so I assume someone is spamming me via an attempted search and trying to find a way in. What I want to do is return a 404 in these cases instead of a 200. It seems the page is dynamically generated and returns a 200 but with an error inside it like this
Warning JUser: :_load: Unable to load user with ID: 35414

I don't really need to fix this page as much as I want the header to include the 404. Can anyone point me in the right direction?

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 11 months ago #165706 by Krikor Boghossian
Replied by Krikor Boghossian on topic Soft404
This can be achieved with Joomla!'s user user object in your overrides.
If the id does not match a user, then you can raise an error page.
docs.joomla.org/Accessing_the_current_user_object

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Steven Roberts
  • Steven Roberts's Avatar Topic Author
  • Offline
  • New Member
More
6 years 11 months ago #165762 by Steven Roberts
Replied by Steven Roberts on topic Soft404
The page is already raising an error but it's returning 200 OK in the header. This is what I want to fix.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 11 months ago #165778 by Krikor Boghossian
Replied by Krikor Boghossian on topic Soft404
You can redirect the user to a 404 error page with that method.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum