Htaccess url仅重定向https网址

时间:2015-09-25 12:46:14

标签: php apache .htaccess redirect

我需要更改所有https(仅限https网址,而非http网址)网址,如下所示:

1)https://www.domain.com/login表示https://www.domain.com/index.php?_route_=login

2)https://www.domain.com/account表示https://www.domain.com/index.php?_route_=login

3)https://www.domain.com/aboutus表示https://www.domain.com/index.php?_route_=aboutus

我如何实现这一目标? 我对.htaccess不太熟悉。

请帮帮我。

1 个答案:

答案 0 :(得分:0)

RewriteEngine On
RewriteCond %{HTTPS} ^on$
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ /index.php?_route_=$1 [NC,L]
相关问题