Welcome! Log In Create A New Profile

Advanced

Re: Rewrite rule for nginx from Apache

Brandon Amaro
May 12, 2011 08:20PM
using http://www.anilcetin.com/convert-apache-htaccess-to-nginx/ , I got
this:

#ignored: condition 0
#ignored: "-" thing used or unknown variable in regex/rew
if (-e $request_filename){
set $rule_1 1;
}
if ($request_filename ~ "-l"){
set $rule_1 1;
}
if (-d $request_filename){
set $rule_1 1;
}
if ($rule_1 = "1"){
#ignored: "-" thing used or unknown variable in regex/rew
}
rewrite ^/index(.*)$ /;
rewrite ^/chat/.* /;
rewrite ^/Songs(.*)$ /;
rewrite ^/Jokes(.*)$ /;
rewrite ^/Ash3ar(.*)$ /;
rewrite ^/iraq/.* /;
rewrite ^/Song/.* /;
rewrite ^/Joke/.* /;
rewrite ^/Poem/.* /;
rewrite ^/link/.* /;
rewrite ^/search/.* /;
rewrite ^/adv-conditions(.*)$ /;
rewrite ^/adv-payments(.*)$ /;
if (-e $request_filename){
set $rule_15 1;
}
if ($request_filename ~ "-l"){
set $rule_15 1;
}
if (-d $request_filename){
set $rule_15 1;
}
if ($rule_15 = "1"){
#ignored: "-" thing used or unknown variable in regex/rew
}
rewrite ^/(?:(.*?)(?:/|$))(.*|$)$ /$1.php?r=$2;

--
omega13a
Owner and Founder of UFT
http://www.fedtrek.com


On 05/12/2011 04:59 PM, the_traveller wrote:
> <IfModule mod_rewrite.c>
> RewriteEngine on
>
> # If you are having problems or are using VirtualDocumentRoot, uncomment
> this line and set it to your directory.
> # RewriteBase/maindir/
> RewriteOptions MaxRedirects=30
> RewriteCond %{ENV:REDIRECT_STATUS} 200
> RewriteRule .* - [L]
>
>
> RewriteCond %{REQUEST_FILENAME} -s [OR]
> RewriteCond %{REQUEST_FILENAME} -l [OR]
> RewriteCond %{REQUEST_FILENAME} -d
>
> RewriteRule ^.*$ - [NC,L]
>
> RewriteRule ^index(.*)$ index.php
> [QSA]
> RewriteRule ^chat/.* pages.php
> [QSA]
> RewriteRule ^Songs(.*)$
> showcat.php?g=2 [QSA]
> RewriteRule ^Jokes(.*)$
> showcat.php?g=3 [QSA]
> RewriteRule ^Ash3ar(.*)$
> showcat.php?g=4 [QSA]
> RewriteRule ^iraq/.* showcat.php
> [QSA]
> RewriteRule ^Song/.* sounds.php
> [QSA]
> RewriteRule ^Joke/.* jokes.php
> [QSA]
> RewriteRule ^Poem/.* poems.php
> [QSA]
> RewriteRule ^link/.* advs.php
> [QSA]
> RewriteRule ^search/.* search.php
> [QSA]
> RewriteRule ^adv-conditions(.*)$
> ad.php?go=conditions [NC]
> RewriteRule ^adv-payments(.*)$
> ad.php?go=payments [NC]
>
> RewriteCond %{REQUEST_FILENAME} -s [OR]
> RewriteCond %{REQUEST_FILENAME} -l [OR]
> RewriteCond %{REQUEST_FILENAME} -d
>
> RewriteRule ^.*$ - [NC,L]
> RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]
>
>
> </IfModule>
>
>
> <IfModule mod_security.c>
> SecFilterEngine Off
> SecFilterScanPOST Off
> </IfModule>
>
> <IfModule mod_gzip.c>
> mod_gzip_on No
> </IfModule>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Rewrite rule for nginx from Apache

Robert Gabriel November 18, 2009 10:24AM

Re: Rewrite rule for nginx from Apache

Denis F. Latypoff November 18, 2009 10:32AM

Re: Rewrite rule for nginx from Apache

Robert Gabriel November 19, 2009 05:32AM

Re[2]: Rewrite rule for nginx from Apache

Denis F. Latypoff November 19, 2009 06:08AM

Re: Rewrite rule for nginx from Apache

Robert Gabriel November 19, 2009 02:28PM

Re: Rewrite rule for nginx from Apache

the_traveller May 12, 2011 07:59PM

Re: Rewrite rule for nginx from Apache

the_traveller May 12, 2011 09:08PM

Re: Rewrite rule for nginx from Apache

the_traveller May 14, 2011 05:38PM

Re: Rewrite rule for nginx from Apache

the_traveller May 17, 2011 06:51PM

Re: Rewrite rule for nginx from Apache

Brandon Amaro May 12, 2011 08:20PM

Re: Rewrite rule for nginx from Apache

Igor Sysoev May 15, 2011 08:52AM

Re: Rewrite rule for nginx from Apache

Igor Sysoev May 18, 2011 02:50AM

Re: Rewrite rule for nginx from Apache

ltss May 18, 2011 10:52PM

Re: Rewrite rule for nginx from Apache

ltss May 20, 2011 04:02PM

Re: Rewrite rule for nginx from Apache

ltss May 22, 2011 08:31PM

Re: Rewrite rule for nginx from Apache

the_traveller May 23, 2011 01:18PM

Re: Rewrite rule for nginx from Apache

Igor Sysoev May 20, 2011 07:22AM

Re: Rewrite rule for nginx from Apache

Igor Sysoev May 25, 2011 07:38AM

Re: Rewrite rule for nginx from Apache

the_traveller May 25, 2011 02:30PM

Re: Rewrite rule for nginx from Apache

Igor Sysoev May 26, 2011 03:06AM

Re: Rewrite rule for nginx from Apache

agung May 26, 2011 12:13AM

Re: Rewrite rule for nginx from Apache

the_traveller May 26, 2011 09:46AM

Re: Rewrite rule for nginx from Apache

Igor Sysoev May 26, 2011 09:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 136
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready