Buongiorno, ho già cercato online e sono riuscito a configurare laravel sul mio progetto altervista tramite i seguenti htaccess
File .htaccess in /
Codice HTML:# av:php5-engine AddHandler av-php82 .php <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteCond %{HTTPS} off RewriteRule ^.*$ https://%{HTTP_HOST}/public%{REQUEST_URI} [L,R=301] RewriteCond %{REQUEST_URI} !^public RewriteRule ^.*$ https://%{HTTP_HOST}/public%{REQUEST_URI} [L,R=301] </IfModule>
File .htaccess in /public
Codice HTML:<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews -Indexes </IfModule> RewriteEngine On # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [L] </IfModule>
Nell'AppServiceProvider ho inserito:
Codice HTML:if ($this->app->environment('production')) { URL::forceScheme('https'); }
funziona tutto se non fosse che le pagine /public sono raggiungibili sia in http che https e vorrei disabilitare l'http.
navigando dalla pagina i redirect sono correttamente in https ma se modifico l'url a mano l'http è valido e non riesco ad uscirne.
ho provato anche a modificare il file htaccess in /public aggiungendo il redirect in https ma mi risponde TOO MANY REDIRECT![]()

LinkBack URL
About LinkBacks
