2017-04-27 23 views
0

我有一个奇怪的问题。当我以SSL模式打开我的域时,http url会被附加到它。 This是我的HTTP URL This是我的SSL URL查看时将http url添加到https url

**其他网址为HTTPS正常打开,但CSS和图像不加载。例如Login页面

我无能为力。请帮助

编辑:这是我的.htaccess

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

    RewriteEngine On 
    RewriteCond %{HTTPS} on 
    RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} 

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

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

    # Handle Authorization Header 
    RewriteCond %{HTTP:Authorization} . 
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 
</IfModule> 

回答

1

试试这个

# Force https 
RewriteCond %{HTTPS} !=on 
RewriteRule^https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 

编辑:

下面与laravel 5.2工作我的生命服务器设置。

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

RewriteEngine On 

# Force https 
RewriteCond %{HTTPS} !=on 
RewriteRule^https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 

# Force Non-www 
RewriteBase/
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] 
RewriteRule ^(.*)$ https://%1/$1 [R=301,L] 

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

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

# Handle Authorization Header 
RewriteCond %{HTTP:Authorization} . 
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 
</IfModule> 
+0

不一样。更新了我的.htaccess – Nitish