Last active
October 9, 2018 22:18
-
-
Save ngstigator/cd49dc62f9b7c1c0b61077f770c017c2 to your computer and use it in GitHub Desktop.
This file contains 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
# Case sensitive | |
rewrite ^/[Nn][Ff][Pp]romo/?$ /now-fresh-offer/ redirect; | |
rewrite ^/(?i)GatherDog/?$ /for-dogs/gather/ permanent; | |
# URL params | |
location /some/path$ { | |
if ($query_string ~* "page=(.*)$") { | |
rewrite ^(.*)$ /destination? permanent; | |
} | |
} | |
# each $arg is identified e.g. ?lang=fr can be referenced by $arg_lang (in this case equals 'fr') | |
if ($args ~ "page_id=(.*)" ) { | |
rewrite /?(.*)?$ /? permanent; | |
} | |
# remove trailing /subpath/ | |
rewrite ^/(.*)/subpath/?$ /$1 permanent; | |
## images from production | |
# Matches any URL containing /wp-content/uploads/ | |
location ~ "^(.*)/content/uploads/(.*)$" { | |
try_files $uri @prod_serv; | |
} | |
# Will redirect requests to your production server | |
location @prod_serv { | |
rewrite "^(.*)/content/uploads/(.*)$" "http://example.com/content/uploads/$2" redirect; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment