Skip to content

Ver 4.1.2 - Phalcon is trying to load subdirectory as Controller #15495

Answered by BeMySlaveDarlin
RickyJaff asked this question in Q&A
Discussion options

You must be logged in to vote

First of all, thank you for report.
There are few ways to fix this, but as is see, you are using some custom server with built-in apache webserver.

  1. Using apache you can trim phalcon4 part of request url in line i marked next:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L] # here
</IfModule>
  1. Or trim /phalcon4 part of request url in index.php:
    //default
    echo $application->handle($_SERVER['REQUEST_URI'])->getContent();
    //fixed
    $requestUri = str_replace('phalcon4', '', $_SERVER['REQUEST_URI']);
    echo $application->handle($requestUri)->getCon…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@RickyJaff
Comment options

@BeMySlaveDarlin
Comment options

Answer selected by RickyJaff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants