Reputation: 79
EDIT I updated my configuration like below:
location / {
rewrite ^/tag/([^/]*)$ /tag/?tag=$1 break;
}
This worked.
How would I have a file structure like this:
/
/tags
index.php
Look like this in the URL: https://example.com/tags/animals
("animals" being the tag, but the page gets animals in a $_GET or some method alike)
I can't have a seperate page for each tag since tags are dynamically made, I figured there would be something to do with rewrite rules. I use nginx as my server, so how would I do something like this?
Upvotes: 0
Views: 97
Reputation: 834
Execute GET request like bellow.
http://myproject/tags/tag1,tag2,tag3
Bellow for URL rewrite.
location /tags {
rewrite ^/tags/([^/]*)$ /tags/?tags=$1 break; }
Upvotes: 2