Skip to content

Instantly share code, notes, and snippets.

@vvoody
Created April 19, 2011 22:59
Show Gist options
  • Save vvoody/929925 to your computer and use it in GitHub Desktop.
Save vvoody/929925 to your computer and use it in GitHub Desktop.
rewrite my old wordpress blog urls to new
# part of /etc/nginx/nginx.conf
server {
listen 80;
server_name vvoody.org;
location ~ /blog[/]?$ {
if ($query_string ~ p=([0-9]+)) {
rewrite ^(.*) http://blog.vvoody.org/article/$arg_p? permanent;
#set $article_id $1;
#rewrite ^(.*) http://blog.vvoody.org/article/$article_id? permanent;
}
rewrite ^ http://blog.vvoody.org/ permanent;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment