gitlist-php / gitlist

An elegant and modern git repository viewer
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

Path of "themes/*" start from webroot instead of the VirtualHost's "Alias" directory location #28

Closed PABourdin closed 7 years ago

PABourdin commented 7 years ago

Hello, this is likely a bug in Silex: I have built and installed our master from 3ad4f03 and have it configured on one of my VirtualHosts using an "Alias" directive, here Alias /gitlist-dev/ /var/www/gitlist-dev/. I did the same with the original version klaussilveira/gitlist but have it instead under Alias /gitlist/ /var/www/gitlist/. Both work in principle, but from our version I see a lot of such GET requests that must of course fail:

IP - [DATETIME] "GET /themes/default/css/style.css HTTP/1.1" 404
IP - [DATETIME] "GET /themes/default/css/gitgraph.css HTTP/1.1" 404

The original version (of course) works fine:

IP - [DATETIME] "GET /gitlist/themes/default/css/style.css HTTP/1.1" 300
IP - [DATETIME] "GET /gitlist/themes/default/css/gitgraph.css HTTP/1.1" 300

We see that obviously the URL for the themes is constructed in a wrong manner in our master. Both VirtualHosts have the identical configuration, except for the location of their directory. Anyone has hints?

PABourdin commented 7 years ago

PS: The RewriteRule and RewriteBase is not the issue, because I see it is working for both installations on "index.php".

PABourdin commented 7 years ago

Even though the issue discussed here is probably unrelated, the given answers might be relevant: https://stackoverflow.com/questions/30034105/htaccess-for-silex

PABourdin commented 7 years ago

I can't find any places, where our application would create the failing requests to /themes/, so I assume this is a bug in Silex or Symfony. Any other opinions?

PABourdin commented 7 years ago

Someone else had a similar issue with phpmyadmin while using Symfony: https://github.com/symfony/symfony/issues/23236 Seems there was a problem in the generation of the request URLs inside the application.

DannyvdSluijs commented 7 years ago

A BC break with upgrading to Silex 2.x was overlooked. This has been applied in #36 The initial commit was based on my previous commit which included additional unit testing. Removed the branch (bug-28) and recreated it from the current HEAD.

PABourdin commented 7 years ago

@DannyvdSluijs great you found and fixed this! Seems I had looked only in src/ and not in the themes/ directory... I really appreciate the help. :-)