Created
October 10, 2014 05:24
-
-
Save MaxLazar/bac36db4b834c7ccd5ac to your computer and use it in GitHub Desktop.
replace underscore to dash with Nginx
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
#http://stackoverflow.com/a/15934256/2183354 | |
location ~ _ { | |
rewrite ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)$ $1-$2-$3-$4-$5-$6-$7-$8-$9; | |
rewrite ^([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)$ $1-$2-$3-$4-$5; | |
rewrite ^([^_]*)_([^_]*)_(.*)$ $1-$2-$3; | |
rewrite ^([^_]*)_(.*)$ $1-$2; | |
rewrite ^ $uri permanent; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment