Jacob
Jacob

Reputation: 79

Sending Empty GET Requests to PHP, but handle the request?

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

Answers (1)

Hirendrasinh S. Rathod
Hirendrasinh S. Rathod

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

Related Questions