Skip to content

Instantly share code, notes, and snippets.

@SchwarzwaldFalke
Created September 16, 2016 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SchwarzwaldFalke/2b0c67a799c3aec88d96e53be6ca629b to your computer and use it in GitHub Desktop.
Save SchwarzwaldFalke/2b0c67a799c3aec88d96e53be6ca629b to your computer and use it in GitHub Desktop.
NGINX rewrite rules
#Remove trailing slash
rewrite ^/(.*)/$ /$1 permanent;
#Rewrite special pages
rewrite ^/(pokemon)/(.+)$ /index.php?page=$1&id=$2 last;
rewrite ^/(pokemon)$ /index.php?page=pokedex last;
#Rewrite pages with default behaviour e.g /gym => index.php?page=gym
rewrite ^/(pokestops|gym|devlog|faq|dashboard)$ /index.php?page=$1 last;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment