Nginx: URL Redirect and regex -
i trying clean url blog's (movable type) search script using rewrite in nginx.
clean search url: (xxx= tag name ex. apple) when access url 404 not found.
http://cgi.blogurl.com/content/brand/apple/
regular search url script path:
http://cgi.blogurl.com/mt/mt-search.cgi?includeblogs=1&tag=apple&limit=20
here have far:
server { listen 80; server_name cgi.blogurl.com; if ($host = "cgi.blogurl.com") { rewrite ^/([^/]*)/$ /mt/mt-search.cgi?blog_id=1&tag=$1&limit=10 break; } }
rewrite ^/?content/brand/([^/]+)/?$ /mt/mt-search.cgi?blog_id=1&tag=$1&limit=10 break;
Comments
Post a Comment