can some1 please convert this htaccess to nginx rewrite?

Igor Sysoev is at rambler-co.ru
Tue Jan 20 17:18:47 MSK 2009


On Tue, Jan 20, 2009 at 02:35:38PM +0100, Lemon Head wrote:

> i attached it , i gave up on the image verification
> and just set it back to vbulletin original captchta
> i'm using the vbseo rewrite rules from the following thread
> http://www.vbseo.com/f4/howto-nginx-23485/ they were posted
> by a person in the vbseo staff so thought theyll be fine
> 
> Attachments:
> http://www.ruby-forum.com/attachment/3183/nginx.conf

You should replace

        # vbseo rewrite
        location /forum/ {
        rewrite ^/forum/((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ /forum/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 last;

        if ($request_filename ~ "\.php$" ) {
        rewrite ^(.*)$ /forum/vbseo.php last;
        }

       if (!-e $request_filename) {
       rewrite ^/forum/(.*)$ /forum/vbseo.php last;
       }
    }

with

        location = /forum {
            fastcgi_pass  127.0.0.1:9000;
            fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/forum/vbseo.php;
            include       fastcgi_params;
        }

        location /forum/ {
            rewrite ^/forum/((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$
                 /forum/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 last;

            error_page  404  = /forum/vbseo.php;
        }

        location ~ ^/forum/vbseo_sitemap/.+\.php$ {
            fastcgi_pass  127.0.0.1:9000;
            fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/$uri;
            include        fastcgi_params;
        }

        location ~ ^/forum/.+\.php$ {
            fastcgi_pass  127.0.0.1:9000;
            fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/forum/vbseo.php;
            include       fastcgi_params;
        }


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list