Skip to content

Instantly share code, notes, and snippets.

@necenzurat
Created May 9, 2013 14:40
Show Gist options
  • Save necenzurat/5547867 to your computer and use it in GitHub Desktop.
Save necenzurat/5547867 to your computer and use it in GitHub Desktop.
pt nginx
rewrite ^/product/(.*).html$$ /products.php?q=$1&rewrite=1 last;
rewrite ^/review/(.*).html$ /reviews.php?q=$1&rewrite=1 last;
#category
location = /category/ {
rewrite ^(.*)$ /categories.php;
}
location = /category {
rewrite ^/category/(.*)/$ search.php?q=category:$1:&rewrite=1 last;
rewrite ^/category/(.*)/(.*).html$ search.php?q=category:$1:&page=$2&rewrite=1 last;
}
#merchant
location = /merchant/ {
rewrite ^(.*)$ /merchants.php;
}
location /merchant {
rewrite ^/merchant/(.*)/$ /search.php?q=merchant:$1:&rewrite=1 last;
rewrite ^/merchant/(.*)/(.*).html$ /search.php?q=merchant:$1:&page=$2&rewrite=1 last;
}
#brand
location = /brand/ {
rewrite ^(.*)$ /brands.php;
}
location /brand {
rewrite ^/brand/(.*)/$ /search.php?q=brand:$1:&rewrite=1 last;
rewrite ^/brand/(.*)/(.*).html$ /search.php?q=brand:$1:&page=$2&rewrite=1 last;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment