Created
May 13, 2018 00:30
-
-
Save VirtuBox/21d05db4e834419e53a8a21cb9c3f804 to your computer and use it in GitHub Desktop.
nginx rewrite rules for custom seo friendly url php script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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