Rewrite rule help

Anoop Alias anoopalias01 at gmail.com
Tue Jun 2 08:51:46 MSD 2009


Thanks Igor,

But that does not work :(.

from what i could find out; i think the URL parsing is handled by the
index.php file itself. so every request to a non existing content must pass
to the index.php file without having any change in the URL. I guess that is
why the apache pass through directive is there (PT). If we delete the PT the
website stops functioning!


I found the following rules working correctly for lightppd

======================
           "^/paOScore(.+)$" => "/?/paoscore/$1",
                "^/paOS(.+)$" => "/?/paos$1",
                "^/SOap(.+)$" => "/?/paos$1",
======================

On similar lines the following nginx rules were created
======================
        rewrite ^/paOScore(.*)$         /?/paoscore/$1  last;

        rewrite ^/paOS(.*)$             /?/paos$1       last;
        rewrite ^/SOap(.*)$             /?/paos$1       last;
========================

Which works but gets the page in a redirect loop if an https page is
requested.it works perfect for the http page

The URL's are all in the format

http://www.domain.com/paos-14-71-1h-49-en.html

http://www.domain.com/paoscore/10-49-en.html


The content is dynamically pulled from a database according to the URL input
;as far as i can see ;this is how it works

there is code snippets in the index.php which says
if ( $_SERVER[ 'REQUEST_URI' ]...
....

etc

any help is much appreciated

Thanks ,
Anoop


2009/5/30 Igor Sysoev <is at rambler-co.ru>

> On Sat, May 30, 2009 at 07:21:06AM +0530, Anoop Alias wrote:
>
> > Thank you Igor,
> >
> > Sorry , that was the wrong apache rewrite rules
> >
> > The correct one is
> > ==================
> > RewriteRule ^(/paos|/soap)(.+) / [NC,L,PT]
> > ==================
> >
> > This is the one that needs to be ported to nginx fomat
>
> location /paos/ {
>    proxy_pass  http://backend/;
> }
>
> location /soap/ {
>    proxy_pass  http://backend/;
> }
>
>
> --
> Igor Sysoev
> http://sysoev.ru/en/
>
>


-- 
Anoop P Alias (PGP Key ID : 0x014F9953)
GNU system administrator
http://GnuSys.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090602/6d1932ad/attachment.html>


More information about the nginx mailing list