Need help with nginx rewrites (for sub-domains)

Jimish Jobanputra lists at ruby-forum.com
Fri Apr 29 14:31:27 MSD 2011


I think, probably I have messed up with something... so my index.php 
looks like this:



        $qstring = explode ( "/" , $_GET["qstr"] ) ;

        if ( $qstring[0] != "" )
        {
                $entity = $data->select ( "SEF_URL" , "*" , array ( 
"URL" => $qstring[0] ) ) ;
                $entity = $entity[0] ;


                switch ( $entity["EntityType"] )
                {
                        case "StaticPage" :
                                $static_page = 1 ;
                                $entity_id = $entity["EntityID"] ;
                                include ( "st_page.php" ) ;
                                break;
                        case "Category" :
                                $category_id = $entity["EntityID"] ;
                                include ( "browse.php" ) ;
                                break;
                        case "Website" :
                                $entity_id = $entity["EntityID"] ;
                                include ( "detail.php" ) ;
                                break;
                        default :
                                include ( "sef_redirector.php" ) ;
                                break;
                }
        }
        else
        {
                include ( "sef_redirector.php" ) ;
        }


It does not expect ?q=uri format... sorry for that...

so now i tried something like:

location ~ /coupons/(.*) {
 root /home/jjobanputra/code/coupon;
 try_files $uri $uri/ /coupons/$1;
 index index.php index.html index.htm;
 expires 30d;
}

but that gives me 500 internal server error..

-- 
Posted via http://www.ruby-forum.com/.



More information about the nginx mailing list