2016-02-11 30 views
0

最近我們在我們的網站中添加了https,但是在兩個鏈接中我們使用的是在http網站上定位的iframe(https不可用)。所以我們認爲我們會將這兩個網址從https重定向到http。 我們添加了重定向但它不起作用。 請告訴我們我們做錯了什麼。下面是我們的.htaccess文件重定向兩個鏈接從https到http

Options +FollowSymlinks 
RewriteEngine on 
Redirect 301 https://www.mydomain.co.in/marketrates/ http://www.kisansanchar.co.in/marketrates/ 
Redirect 301 https://mydomain.co.in/marketrates http://www.mydomain.co.in/marketrates 
Redirect 301 https://www.mydomain.co.in/weather/checklocalweather.htm http://www.mydomain.co.in/weather/checklocalweather.htm 

回答

0

嘗試使用mod_rewrite相反,Redirect指令是mod_alias中的一部分,你不能,如果被請求的主機檢查還是它的HTTP或HTTPS(除非你把他們安置在一個特定的虛擬主機而不是htaccess文件)。

因此,像這樣:

Options +FollowSymlinks 
RewriteEngine on 

RewriteCond %{HTTPS} on 
RewriteRule ^(marketrates/?|weather/checklocalweather\.htm)$ http://%{HTTP_HOST}/$1 [L,R=301]