Hi, I want to know how to redirect anything from domain.com/RNWAWFKNAL [something random] to a error page, instead of my homepage as it redirects automatically. This is for the instances of folders. Thanks
Add to your .htaccess a redirection directive like this Redirect permanent /folder1 http://new-location/error_page Redirect permanent /folder2 http://new-location/error_page Code (markup): etc, etc.
lol,that will be a lot of work.... I think 404 error page works for them too as long as they are not existent?
Yes, this would be impossible. I'm trying to cover all folders that don't exist. Nah Only for images at the moment for my site.
The default behaviour is to show a 404 page whenever anything (files and folders) is requested that does not exist. It sounds like you already have some htaccess rules or similar that is interfering and redirecting to the homepage. If that's nothing you know about, I'd suggest contacting your host and checking its not anything to do with them.
If you request a file or directory that does not exist, your server will give a 404 error page unless you've told it to do otherwise. There is no sensible way of making it show the 404 page instead of redirecting to the homepage, other than removing whatever is already in place that's causing it to redirect.