there is a problem with Kirby 3 when using Apache’s
VirtualDocumentRoot functionality (having multiple virtual hosts with only one configuration block in httpd.conf):
When trying to access the kirby pages, the path is not found. As soon as i change apache’s configuration to a regular virtualhost configuration everything works as expected).
With the very first version of Kirby 3 i tracked that problem down and changed one line of code in the area somewhere around the request uri is detected. Than kirby works with both regular virtual hosts and VirtualDocumentRoot configurations as well. Its just one simnple thing where the current request uri is not build properly… but I can’t find it again and now i need to upgrade to the current version…
Therefore i need the help of the developing team to fix that kirby bug. It is very easy to reproduce:
mod_vhost_alias and set up a configuration like this:
# include the server name in the filenames used to satisfy requests
This serves virtual hosts from directories like:
and so on.
The problem is that kirby can not detected the request uri and will not serve any request. Instead it shows up an error message that something went wrong.
Any help is welcome.
I got it in
< $requestUri = '/' . $this->request()->url()->path();
> $requestUri = '/' . str_replace($_SERVER['HTTP_HOST'],"",$this->request()->url()->path());
In 3.2-rc1 this situation still exists, too. After fresh install 3.2-rc1 just keeps saying “Not found”.
As soon as you change that line, it starts working again under both conditions: Apache2 regular virtual hosts, and VirtualDocumentRoot configurations as well
Please consider taking this one over into the code base for the next release candidate.
Hopefully this can be updated for 3.2-rc2 @texnixe
I don’t know if this is a bug or not, please either create a bug issue in the kirby repo or a feature request in the ideas repo.
In your fix "Remove host from REQUEST_URI in Uri class (Fix #1830) "
there is something hardcoded:
Please check, whether this is intended (
Sorry, I’m no profi in such coding, but I didn’t expect anything like that in the code.
That’s intended. It has been in there before. The parse_url method needs a full URL, not just a path, otherwise it will fail. Appending our domain is only there to make the parser work. The rest of the URL is detected further down.
I also have the same problem, this is how my vhost conf look like:
I’ve also tried the one from the arch wiki here.
With both configs I only get 404 errors on any subpage. I don’t know what is wrong with but it has defenitely to do with kirby itself and not my own config as it is working with other CMS quite nice.
My whole httpd.conf http://ix.io/1LxQ
@glumanda Have you tested if 3.2rc2 fixes this?
As already mentioned above, 3.2 is supposed to fix the issue.
@texnixe Yes, but it still won’t fix the issue for me. I don’t know what to do next, using php’s builtin server sucks.