2017-06-14 1 views
-1

Ich bin neu in Laravel Framework. Mit Ausnahme der Startseite wird jede zweite Seite auf https umgeleitet, was bei Verwendung von "php artisan serve" nicht funktioniert. Ich überprüfte routes.php und Middleware Ich konnte keine solche Sache in der Konfiguration finden, die https erzwingt.Laravel - Redirects zu https

Routen:

Route::group(array('prefix' => 'admin'), function() { 


Route::controller('/form', 'Admin\FormController'); 
..... 

............ 


Route::controller('/guide', 'Admin\GuideController'); 


Route::controller('/userlist', 'Admin\UserController'); 
Route::controller('/useradd', 'Admin\UserController'); 

Route::controller('/locationlist', 'Admin\LocationController'); 
Route::controller('/locationadd', 'Admin\LocationController'); 



Route::controller('/', 'Admin\AdminController'); 

}); 



Route::controller('/', 'Site\SiteController'); 

.htaccess:

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

    RewriteEngine On 

    RewriteCond %{SERVER_PORT} 80 
    RewriteRule ^(.*)$ https://....../$1 [R,L] 

    # Redirect Trailing Slashes... 
    RewriteRule ^(.*)/$ /$1 [L,R=301] 

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

</IfModule> 

php_value post_max_size 200M 
php_value upload_max_filesize 200M 
+0

bearbeiten Ihre Frage ein und laden .htaccess-Datei Code –

+0

Ihr Problem ist in der '.htaccess' Datei –

+0

@Jadoon Added .htaccess-Datei. –

Antwort

0

können Sie mit .htaccess gelöst. fügen diese Codes in .htaccess-Datei

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

    RewriteCond %{HTTPS} !on 
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] 
+0

Aber auf localhost auch die Umleitung zu https –

+0

@VivekSadh tun Sie das nur für Ihre Produktion .htaccess Datei – Fahmi

+0

, aber ich kann nichts auf localhost testen. Es leitet immer zu https um. Ich muss es manuell auf http ändern, dann funktioniert es. –