Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Problem viewing file name "index.php" in repo #253

richRemer opened this Issue · 9 comments

3 participants


When I try to navigate to a file in my git repo named "index.php" (/devkit/blob/stable/index.php), GitList shows the home page instead of the file in the git repo. All the styles are busted because the CSS URLs are no longer valid, but it otherwise appears just like when I navigate to /.

Maybe I'm doing something wrong, but it feels like a bug.

Apache rewrites (maybe relevant? I don't see how)

RewriteEngine On
RewriteLog /var/log/httpd/rewrite_log
RewriteRule ^.*$ /index.php [L]


Hi there,

Yes, this could be due to rewriting. The issue here is the slash in in the RewriteRule, it should be:

RewriteRule ^.*$ index.php [L]

This is issue was fixed in #214, so getting the latest release from github should solve this problem. Otherwise, take the slash out yourself and see if that works for you.


Without the slash, I just get 400 Bad Request. Presumably, this is because Apache sees a request like GET index.php (without the trailing slash).


As a test, I updated it to:

RewriteRule ^.*$ %{DOCUMENT_ROOT}/index.php [L]

...with the same behavior as initially (index.php files won't load).


This is the rewrite rule from my gitlist, it works fine for my case:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,NC]

That gives me a Bad Request again. :/


Also, I noted the problem talked about in #214 is related to a 404. I do not get any 404s. As long as I don't get a 400, all requests successfully make it to the index.php file. It's just that GitList displays the wrong page if the git repo file is index.php.


Sorry that I can't help you further :-(.

The 404 occurred in #214 because there was no index.php in the document root of the webserver. If it was there, it would have been displayed instead of the 404. Unfortunately, that solution doesn't work for your case.


What's your Apache version?


Works in latest master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.