Tuesday, 27 August 2013

htaccess to nginx conversion reverse proxy to keep URL

htaccess to nginx conversion reverse proxy to keep URL

i am using post affiliate pro they have a script to turn a web page at
www.example.com into a banner for affiliates, the htaccess uses a php
script to load the i am trying to convert the htaccess to nginx conf file.
i have tried the converters at winginx and anilcetin they work but it
changes the url from www.example to pap.example.
on an Apache server with .htaccess the url is maintained www.example. this
is what i am trying to duplicate on the nginx server.
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/(.*)
http://pap.example.com/scripts/page.php?a_aid=$1&a_bid=7c4ec277&a_file=$2
[L,P,QSA
]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)
http://pap.example.com/scripts/page.php?a_aid=$1&a_bid=7c4ec277&a_redir=Y
[L,P,QSA
]
thanks for any help
Sean

No comments:

Post a Comment