0

I have a problem with configure Silex and HTTPS. I added my Silex application to the https server. Login module is ok, but redirection is doesn't works. Website mypage.com works, but all created paths (url function in twig) returns url with http (ex. http://mypage.com/delivery). I tried the requireHttps function, but then I get the error "loop redirect". How to configure silex for url to return url from https?

.htaccess:

<IfModule mod_rewrite.c>
Options -MultiViews

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]

Example twig file:

<ul class="nav nav-pills nav-stacked">
    <li class="menu_li text-center data-url="{{ url('first') }}">First</li>
    <li class="menu_li text-center data-url="{{ url('second')}}">Second</li>
</ul>

Example route (doesn't work):

$app->get('/first', function(Request $request) use ($app) {
   return 'FIRST';
})
->bind('first')
->requireHttps();

0 Answers0