Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble with Apache setup #25

Open
studiorepublic opened this issue May 27, 2015 · 2 comments
Open

Trouble with Apache setup #25

studiorepublic opened this issue May 27, 2015 · 2 comments

Comments

@studiorepublic
Copy link

Uncached pages work fine, but anything which has been cached throws a 404. Here's my config

RewriteCond %{DOCUMENT_ROOT}/versant-homes/statcache%{REQUEST_URI}/~index.html -f
RewriteRule ^(.*)$ versant-homes/statcache/$1~index.html [L,QSA]

RewriteCond %{DOCUMENT_ROOT}/versant-homes/statcache%{REQUEST_URI} -f
RewriteRule ^(.*)$ versant-homes/statcache/$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ versant-homes/index.php?q=$1 [L,QSA,NC]

Any ideas would be great!

@opengeek
Copy link
Owner

I don't have any apache setups available atm—I prefer nginx—but could it be that the rules are capturing the opening slash resulting in two slashes when used in the replacement? IOW, should the rules look like this instead:

RewriteRule ^/(.*)$ versant-homes/statcache/$1 [L,QSA]

^ notice the opening slash not within the capture for $1

@opengeek
Copy link
Owner

Actually, a different suggestion was just to add an initial slash to the rule target, e.g.

RewriteRule ^(.*)$ /versant-homes/statcache/$1~index.html [L,QSA]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant