Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

URL Rewrite

Started by Muut Archive 10 years ago · 0 replies · 515 views
10 years ago

I am currently trying to rewrite some URLs because I somehow need to get data from one page to another and these values are passed by params in the url. But in the end I don't want to have these params in the URL so I am trying around with Rewrite and Redirect.

This is the following that I have:

TXT
redirects:
    /page/subpage/param1:([0-9]+)\/param2:(.+)$': '/page/subpage/$1/$2'

But unfortunately this is not working. Param1 is just a numeric ID (4 digits) where Param2 is a string like Url (some-nice-url-here) all lowercase with dashes in between). So I am wondering if my rewrite approach is possible at all or not. Or maybe I am doing something wrong with the Regex parameters?

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 2574 9 years ago
Archive · by Muut Archive, 9 years ago
2 1694 9 years ago
Archive · by Muut Archive, 9 years ago
2 4985 9 years ago
Archive · by Muut Archive, 9 years ago
1 3812 9 years ago
Archive · by Muut Archive, 9 years ago
3 1802 9 years ago