Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Dec 20, 2014 9:34 pm 
Offline
Senior Member

Joined: Thu Jun 13, 2013 7:32 am
Posts: 79
Does this look right?

htaccess

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-zA-Z0-9\-]+)/?([a-zA-Z0-9\-]+)?/?([0-9]{1,2}\.[0-9]{2,3})?/?$ index.php?l=$1&s=$2&c=$3&q=%{QUERY_STRING}

nginx

location / {
if (!-e $request_filename){
rewrite "^/([a-zA-Z0-9\-]+)/?([a-zA-Z0-9\-]+)?/?([0-9]{1,2}\.[0-9]{2,3})?/?$" /index.php?l=$1&s=$2&c=$3&q=$query_string;
}
}


Top
   
PostPosted: Sat Dec 20, 2014 11:30 pm 
Offline
Senior Member

Joined: Thu Feb 20, 2014 5:06 pm
Posts: 58
You should avoid "if" with Nginx. See http://wiki.nginx.org/IfIsEvil

I think this will work, but it's been awhile since I've used Nginx:
Code:
location / {
    try_files $uri $uri/ @router;
}

location @router {   
     rewrite "^/([a-zA-Z0-9\-]+)/?([a-zA-Z0-9\-]+)?/?([0-9]{1,2}\.[0-9]{2,3})?/?$" /index.php?l=$1&s=$2&c=$3&q=$query_string;
}


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group