Currenty, I am using .htaccess
file to redirect users to 404.php
page when they mis-spell the url.
ErrorDocument 404 /mywebsite/404.php
In my parent directory, there are some folders like css, js in which stylesheets and js files are kept. URL for these directories is like this:
localhost/mywebsite/css
localhost/mywebsite/js
By typing above urls, all the files are listed in the browser and can be opened by clicking on them.
Is there any way to add these urls in .htaccess file and redirect the user to home page (localhost/mywebsite
) when they try to type above urls on the browser?