2016-06-08 46 views
-1

任何人都可以请帮助我停止https重定向的特定网址,htacces正在使用多个停放的域名,所以我只使用https为我的主域名只有例如(“www .domain.com“)请找我目前的.htaccess如何避免https使用.htacess

#ssl 
RewriteCond %{HTTP_HOST} ^www\.domain\.com [NC] 
RewriteCond %{HTTPS} off 
RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301] 

我想以下网址并非位于https

https://www.domain.com/setup/abc/{ID} 
https://www.domain.com/setup/abc 

等重定向..

基本上我希望网址不是重定向WH其中包括/setup/

回答

1
RewriteEngine On 
RewriteCond %{HTTP_HOST} ^www\.domain\.com [NC] 
RewriteCond %{HTTPS} off 
RewriteRule ^((?!^setup/).*)$ https://www.domain.com/$1 [L,R=301] 

这应该做的伎俩。

+1

为什么修改rewriteRule,而不是只为请求的uri添加另一个rewriteCond? – yosefrow

+0

@yosefrow先对RewriteRule进行解析。 – hjpotter92

+0

我明白了。感谢您的解释 – yosefrow