2016-03-01 33 views
1

我有一個網站與ssl。來自網站的所有網頁都通過www重定向到https。如何使用htaccess從特定的網址或頁面刪除ssl

我想要下面的網址是非SSL的,所以它只能使用http。

www.domain.com/admin/order/remote_request? 
www.domain.com/admin/order/print/131756 

我現在htacess文件是廣告如下

<IfModule mod_rewrite.c> 
    <IfModule mod_negotiation.c> 
     Options -MultiViews 
    </IfModule> 

    RewriteEngine On 

    # Redirect Trailing Slashes If Not A Folder... 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)/$ /$1 [L,R=301]   

    # Redirect non www request to www 
    RewriteCond %{HTTP_HOST} !^www\. 
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]   

    # Redirect http request to https 
    RewriteCond %{HTTPS} off  
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 

    # Handle Front Controller... 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteRule^index.php [L] 
</IfModule> 

回答

1

嘗試:

# Redirect http request to https 
RewriteCond %{THE_REQUEST} !/admin/order/remote_request\? [NC] 
RewriteCond %{THE_REQUEST} !/admin/order/print/131756 [NC] 

    RewriteCond %{HTTPS} off  
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 
相關問題