We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Phalcon routing over SSL

I am using a Micro application to define a REST API. Everything is working well with HTTP requests to the API when the url protocol is http, but when I use https the route is not found (404 response). The base URI is set to a full path using https:

$url->setBaseUri('https://localhost/adaptive-exhibit/');

routes are defined like so:

$app->post('/userlogin', "UserController::authGoogle");

I tested with Ajax and CURL with a post request to https://localhost/adaptive-exhibit/userlogin It only works if I change https to http in the request url. I have ssl enabled and can access other pages on the same domain over https. For example, I can send a POST request using https to the same file that is defining these routes and it will find the page.
The problem seems to have something to do with the routes being defined on http and not https even though I changed the base uri and pages on the domain are available over https. My rewrite rules look like:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
</IfModule>

The Apache host has Options All set Any ideas? Thank you!



1.1k
Accepted
answer

Oops my bad, I didn't have the AllowOverride directive set for the application in the correct apache config file. Problem solved, sorrry!