Skip to content

Instantly share code, notes, and snippets.

@VirtuBox
Created May 13, 2018 00:30
Show Gist options
  • Save VirtuBox/21d05db4e834419e53a8a21cb9c3f804 to your computer and use it in GitHub Desktop.
Save VirtuBox/21d05db4e834419e53a8a21cb9c3f804 to your computer and use it in GitHub Desktop.
nginx rewrite rules for custom seo friendly url php script
location /
{
try_files $uri @url;
}
location ~ \.php$
{
try_files $uri =404;
include fastcgi_params;
fastcgi_pass php7;
}
location @url
{
rewrite ^/(.+)$ /index.php?route=$1 last;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment