Skip to content

Using rewrite for OctoberCMS #79

Description

@marianielias

Hi,
I'm trying to adapt the rewrite rules of OctoberCMS to httpd.conf.
Now everything is working ok with this rules:

#example of directory that doesn't need to use rewrite.
location match "/themes/(.*)/assets/(.*)" {
request no rewrite
}

#index.php is the entry point of the application and runs the php fastcgi.
location match "index.php" {
fastcgi socket "/run/php-fpm.sock"
}

#all others locations rewrite to /index.php
location match "(.*)" {
request rewrite "/index.php$REQUEST_URI"
}

The problem is that when rewriting to index.php in this manner the links are formatted in the same way as the rewrite, is there a way apart from "request strip" that I can use to change the $REQUEST_URI so the fastcgi socket gets the value with the "/index.php" striped ?
Or even better: a way to keep the original $REQUEST_URI ?

Cheers.

Activity

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