index index.php;

# nginx configuration

location ~ page-[0-9]+\.html?$ {
}

location / {
  if (!-e $request_filename){
    rewrite (.*)detail/(.*)$ /index.php?controller=system&action=detailsredirect&id=$2 last;
  }
  if (!-e $request_filename){
    rewrite ^/detail.php /index.php?controller=system&action=detailsredirect&id=$1 last;
  }
  if (!-e $request_filename){
    rewrite ^/alphameric/([A-Za-z]|0\-9)$ /index.php?controller=alphameric&id=$1 last;
  }
  if (!-e $request_filename){
    rewrite ^/contact /index.php?controller=contact last;
  }
  if (!-e $request_filename){
    rewrite ^/search/([^/]+) /index.php?controller=search&action=$1 last;
  }
  if (!-e $request_filename){
    rewrite ^/search /index.php?controller=search last;
  }
  if (!-e $request_filename){
    rewrite ^/latest /index.php?controller=index&action=latest last;
  }
  if (!-e $request_filename){
    rewrite ^/top /index.php?controller=index&action=top last;
  }
  if (!-e $request_filename){
    rewrite ^/rss /index.php?controller=index&action=rss last;
  }
  if (!-e $request_filename){
    rewrite ^/user/thankyou$ /index.php?controller=user&action=thankyou last;
  }
  if (!-e $request_filename){
    rewrite ^/user/confirmed$ /index.php?controller=user&action=confirmed last;
  }
  if (!-e $request_filename){
    rewrite ^/user/sendpassword$ /index.php?controller=user&action=sendpassword last;
  }
  if (!-e $request_filename){
    rewrite ^/user/recovered$ /index.php?controller=user&action=recovered last;
  }
  if (!-e $request_filename){
    rewrite ^/submit$ /index.php?controller=submit last;
  }
  if (!-e $request_filename){
    rewrite ^/submit/confirmed$ /index.php?controller=submit&action=confirmed last;
  }
  if (!-e $request_filename){
    rewrite ^/payment/([^/?]+) /index.php?controller=payment&action=$1&$query_string last;
  }
  if (!-e $request_filename){
    rewrite ^/payment /index.php?controller=payment last;
  }
  if (!-e $request_filename){
    rewrite ^/user/submissions$ /index.php?controller=user&action=submissions last;
  }
  if (!-e $request_filename){
    rewrite ^/user/register$ /index.php?controller=user&action=register last;
  }
  if (!-e $request_filename){
    rewrite ^/login$ /index.php?controller=user&action=login last;
  }
  if (!-e $request_filename){
    rewrite ^/logout /index.php?controller=user&action=logout last;
  }
  if (!-e $request_filename){
    rewrite ^/user/profile /index.php?controller=user&action=profile last;
  }
  if (!-e $request_filename){
    rewrite ^/user/([^/?]+) /index.php?controller=user&action=$1&$query_string last;
  }
  if (!-e $request_filename){
    rewrite ^/user /index.php?controller=user&action=index last;
  }
  if (!-e $request_filename){
    rewrite ^/article/(.*)$ /index.php?controller=article&idArticle=$1 last;
  }
  if (!-e $request_filename){
    rewrite ^/tag/(.*)$ /index.php?controller=tag&tag=$1 last;
  }
  if (!-e $request_filename){
    rewrite ^/location/([\ /0-9a-zA-Z,_-]*)/(.*) index.php?controller=location&location=$1&category=$2 last;
  }
  if (!-e $request_filename){
    rewrite ^/location/(.*)$ /index.php?controller=location&location=$1 last;
  }
  if (!-e $request_filename){
    rewrite ^/listing/comment/([0-9]*)$ /index.php?controller=details&action=comment&idLink=$1 last;
  }
  if (!-e $request_filename){
    rewrite ^/listing/rate/([0-9]*)$ /index.php?controller=details&action=rate&idLink=$1 last;
  }
  if (!-e $request_filename){
    rewrite ^/listing/(.*)/(.*)([/]*)$ /index.php?controller=details&idLink=$2 last;
  }
  if (!-e $request_filename){
    rewrite ^/listing/(.*)/(.*)([/]*)$ /index.php?controller=details&idLink=$2 last;
  }
  if (!-e $request_filename){
    rewrite ^/rules([0-9]*)$ /index.php?controller=index&action=rules last;
  }
  if (!-e $request_filename){
    rewrite (.*)authors/author-(.*)\.htm[l]?$ /author.php last;
  }
  if (!-e $request_filename){
    rewrite (.*)owner/owner-(.*)\.htm[l]?$ /author.php last;
  }
  if (!-e $request_filename){
    rewrite ^/page/(.*)([/]*)$ /index.php?controller=page&action=index&name=$1 last;
  }
  if (!-e $request_filename){
    rewrite ^/(.+)\.html$ /index.php?controller=page&name=$1 last;
  }
  rewrite ^/(.*)loadingAnimation.gif$ /javascripts/thickbox/loadingAnimation.gif;
  if (!-e $request_filename){
    rewrite ^/tellfriend /index.php?controller=details&action=tellfriend last;
  }
  if (!-e $request_filename){
    rewrite ^/unauthorized /index.php?controller=index&action=unauthorized last;
  }
  if (!-e $request_filename){
    rewrite ^/banned-massage /index.php?controller=index&action=banned last;
  }
  if (!-e $request_filename){
    rewrite ^/detail/(.*)-([0-9]*)[\..*] /index.php?controller=system&action=detailsredirect&id=$2 last;
  }
  if (!-e $request_filename){
    rewrite ^/detail.php /index.php?controller=system&action=detailsredirect&id=$1 last;
  }

    rewrite ^(.*)$ /index.php last;

}