Skip to content

Trouble with Apache setup #25

Open

Description

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!

Activity

  1. opengeek commented on May 27, 2015

    @opengeek
    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

  2. opengeek commented on May 27, 2015

    @opengeek
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions