Rewrite lookup via MySQL table

btafoya nginx-forum at
Tue Aug 24 22:27:57 MSD 2010

I have the php code working to redirect correctly, but have run into a
obstacle I don't know how to resolve....

The is the incoming URL, or one of them...

I have tried to intercept it but just created a loop. The handler I
wrote is index_loader.php.

    location ~ \.html/ { ## Forward
        rewrite ^(.*)/ index_loader.php?source_url=$1 last;
    location @handler { ## Magento uses a common front handler
        rewrite / /index.php;

    location ~ \.php/ { ## Forward paths like /js/index.php/x.js to
relevant handler
        rewrite ^(.*\.php)/ $1 last;

How do I go about redirecting all .html traffic to the new handler
without interfering with the Magento front controller?

Thanks again for everyone's help!

Posted at Nginx Forum:,122977,123227#msg-123227

More information about the nginx mailing list