Nginx rewrite rules help

Status
Not open for further replies.

GoDofAdeN

Active Member
117
2011
21
180
Im looking for some help to make those nginx rules run smoothly from apache2 htaccess :

RewriteRule ^api$ api.php [L]
RewriteRule ^admin/(.*) admin/index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

Thanks for the help!
 
11 comments
Thats all my htaccess file:

Code:
RewriteRule ^api$ api.php [L]
RewriteRule ^admin/(.*) admin/index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

Thanks in advance for the help sir :)
 
Try this:

if ($rule_0 = ""){
rewrite ^/api$ /api.php last;
}
if ($rule_1 = ""){
rewrite ^/admin/(.*) /admin/index.php last;
}
if (!-f $request_filename){
set $rule_2 1$rule_2;
}
if (!-d $request_filename){
set $rule_2 2$rule_2;
}
if ($rule_2 = "21"){
rewrite /. /index.php last;
}
 
too bad that website is outdated, and still 1 rule is missing. simply their conversions dont work on latest nginx release.

also, dont be rude, Im here to ask for help, not to waste your time, if you cant help, dont reply, thanks.
 
Status
Not open for further replies.
Back
Top