Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
richRemer opened this Issue · 9 comments

3 participants

@richRemer

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
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteRule ^.*$ /index.php [L]

@wimrijnders
Collaborator

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.

@richRemer

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).

@richRemer

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).

@wimrijnders
Collaborator

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]
@richRemer

That gives me a Bad Request again. :/

@richRemer

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.

@wimrijnders
Collaborator

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.

@klaussilveira

What's your Apache version?

@klaussilveira

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.