Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Re: Nginx location group capture + rewrite?

$
0
0
I solved the issue by doing this instead :

location ~* /(cars|trucks|bikes|motorcycle|quad-bikes) {
rewrite ^/([a-zA-Z-]+)/([0-9]+)(.*)$ /page.php?id=$2 last;
...
...
}


The regex ([a-zA-Z-]+) allows me to use characters a-z (case insensitive) with possible dashes in my category / page names.

Viewing all articles
Browse latest Browse all 4759

Trending Articles