简体   繁体   中英

htaccess redirecting in some cases

I got an .htaccess file which redirects any request to index.html:

But i want, that only in case if somebody request to

www.mypage.com/login

that he will redirected to a file which is located in

/html/login.html

Here my file till now:

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)$ index.html [NC]

How to implement this? Thx!

RewriteEngine on
RewriteBase /
Options +FollowSymlinks

RewriteRule ^/?login/?$ http://www.mypage.com/html/login.html [NC,R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.html [NC]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM