How To Use .htaccess To Do A Redirect From /login To /login/login.html
I'm trying to use .htaccess or any other method so that when a user types in
it will redirect to
I'm using apache2 on a debian 9.x server and have tried using mod_rewrite and RewriteRule. Neither are working.
Here is what I have currently:
RewriteOptions inherit RewriteEngine on RewriteRule ^login$ "https\:\/\/websitename\.com\/login\/login\.html" [R=301,L]
any help would be appreciated. Thanks in advance :)
Since /login/ is an existent directory on your server, you need to trun off directory slash to redirect /login (without a traling slash) to /login.html .
RewriteEngine on DirectorySlash off RewriteRule ^login$ /login/login.html [L,R]
Clear your browser cache before testing this.
- → Laravel 5: Apache php http authentication
- → Htaccess negation
- → OctoberCMS error in frontend - frontend is not accessible firing error "Default value for parameters with a class type hint can only be NULL"
- → How to give access execute specific php file in server?
- → 301 Redirection from no-www to www in wordpress
- → Cyclical redirection at the start laravel 5 project
- → Can't route in Laravel framework
- → How to benefit of prerender.io services if my Apache server doesn't allow a proxy
- → OctoberCMS installation MYSQL error
- → Redirect 301 htaccess prestashop
- → Permissions "public" folder Laravel
- → .htaccess affect other file url
- → How i can redirect from "www.mywebsite.com////" to "www.mywebsite.com"?