Welcome! Log In Create A New Profile

Advanced

Re: Help converting Apache HTACCESS directives to nginx?

August 22, 2010 02:12PM
On Sun, Aug 22, 2010 at 10:55:50AM -0400, st1905 wrote:

> [code]
> if ($http_host ~ "^www.domain.com"){
> set $rule_0 1$rule_0;
> }
> if ($rule_0 = "1"){
> rewrite /(.*) http://domain.com/$1 permanent;
> break;
> }
> if ($http_host ~ "^beta.domain.com"){
> set $rule_1 1$rule_1;
> }
> if ($rule_1 = "1"){
> rewrite /(.*) http://domain.com/$1 permanent;
> break;
> }
> if (!-f $request_filename){
> set $rule_2 1$rule_2;
> }
> if (!-d $request_filename){
> set $rule_2 2$rule_2;
> }
> if (!-f $document_root/$1.php){
> set $rule_2 3$rule_2;
> }
> if (-f $document_root/msg.html){
> set $rule_2 4$rule_2;
> }
> if ($rule_2 = "4321"){
> setenv ${escapemap:$1}&template;
> rewrite ^/([a-z0-9_\-@#\ /"'\+]+)/?([a-z0-9_\-]+)?(\.png|/)?$;
> }
> if ($uri !~ "/msg.html$"){
> set $rule_3 1$rule_3;
> }
> if ($uri !~ "/generation/image.php$"){
> set $rule_3 2$rule_3;
> }
> #ignored: condition 2
> #ignored: condition 3
> if (-f $document_root/msg.html){
> set $rule_3 5$rule_3;
> }
> if ($rule_3 = "541"){
> rewrite /$ /msg.html last;
> }
> #ignored: condition 0
> rewrite ^/(index|index\.php)$ http://domain.com/ permanent;
> break;
> if (-f $document_root/$1.php){
> set $rule_5 1$rule_5;
> }
> if ($rule_5 = "1"){
> rewrite ^/(.*)$ /$1.php last;
> }
> if (-f $document_root/$1.php){
> set $rule_6 1$rule_6;
> }
> if ($rule_6 = "1"){
> rewrite ^/(.*)/$ http://domain.com/$1 permanent;
> break;
> }
> #ignored: condition 0
> if (-f $document_root/$1.php){
> set $rule_7 2$rule_7;
> }
> if ($rule_7 = "21"){
> rewrite ^/([^.]+)\.php$ http://domain.com/$1 permanent;
> break;
> }
> #ignored: condition 0
> #ignored: condition 1
> setenv ${escapemap:$1}&template;
> rewrite ^/([a-z0-9_\-@#\ /"'\+]+)/?([a-z0-9_\-]+)?(\.png|/)?$;
>
> [/code]

No, you should not use this sendmail style configuration.
However, I do not understand what the original htaccess should do.


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

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Help converting Apache HTACCESS directives to nginx?

christek August 08, 2010 11:20PM

Re: Help converting Apache HTACCESS directives to nginx?

st1905 August 22, 2010 10:55AM

Re: Help converting Apache HTACCESS directives to nginx?

Igor Sysoev August 22, 2010 02:12PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 83
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready