hello I have a website that includes an /admin folder in this folder I have a login.php file
How can I make it redirect the website.com/admin to website.com/admin/login.php using .htaccess inside the /admin folder ?
OK, this is even simpler and can be done like this:
RewriteCond %{REQUEST_URI} ^/admin$
RewriteRule .* http://yourhostname.tld/admin/login.php [L]
Just adjust the domain name to your needs.
Try this:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* login.php [L]
This will redirect all request to login.php if 1) requested resource is not an existing file 2) requested resource is not an existing directory 3) requested resource is not an existing link 4) This will be the last redirect rule used