Reputation: 123
For quite a while, I've been observing the 404 error log file, and I found that from nowhere, the visitors landed in subdirectories containing numbers that don't exist. And there are more than 50% humans. Although the parent directory does exist, instead of getting back to the parent directory, they are seeing another page that I've set for 404 errors (in simple words, they see a 404 error).
For example:
https://www.example.com/crush/1000
In the upper URL, I don't know who referred to this page with an ending of 1000, and it's not on my server. Now this page will redirect you to https://www.example.com/list/
as I set it, instead of seeing the typical 404 error page.
Now what I want to do is redirect any visitor who visits such pages to the parent directory using .htaccess
, i.e.
https://www.example.com/crush/
Remember, the value 1000 is not a fixed value; it could be any number, even including points (.
) and slashes (/
).
A few examples are:
https://www.example.com/bon-appetit/0.192840405
https://www.example.com/new-kid-on-the-block//100000
https://www.example.com/list/alphabetical/0.12417095834474612
https://www.example.com/a-quick-buck/&ved=2aqfnoecc4qag&usg=aovvaw3ed5h
NOTE: I'm using LiteSpeed not Apache.
Your help is highly appreciated.
Upvotes: 0
Views: 59