amuck-landowner

Anyone can convert this into Nginx rewrite rules?

isy44h112

New Member
I need help converting this Apaceh rewrite rules into Nginx


Options +FollowSymLinks -MultiViews


RewriteEngine On


RewriteBase /


RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]


RewriteRule ^ %1 [R,L,NC]


RewriteCond %{REQUEST_FILENAME}.php -f [NC]


RewriteRule ^ %{REQUEST_URI}.php [L]


Thanks.
 
Last edited by a moderator:

5n1p

New Member
Code:
#ignored: condition 0
if ($rule_0 = "1"){
rewrite ^/ /$bref_1 redirect;
}
if (-f $request_filename.php){
set $rule_1 1$rule_1;
}
if ($rule_1 = "1"){
rewrite ^/ /$uri.php last;
}

 

according to http://www.anilcetin.com/
 

apt

New Member
Code:
location / {
  rewrite "^[A-Za-z]{3,}\s([^.]+)\.php" $1 redirect;
  try_files $uri.php =404;
}
 
Top
amuck-landowner