Welcome! Log In Create A New Profile

Advanced

Rewrite if directory doesn't exist

Posted by tfe 
tfe
Rewrite if directory doesn't exist
May 02, 2012 06:09AM
I use this rule for rewriting if directory doesn't exist:

if (!-d $request_filename ) {
rewrite ^/([^/.]+)$ /profile.php?nick=$1 last;
}

The tutorial says that "if" is bad. Is there any way how to change this rule so tyhat it works without "if"?
Thanks.
tfe
Re: Rewrite if directory doesn't exist
May 06, 2012 10:06AM
Noone can answer this question?

Please, I need it urgently. The new server is ready and I have to disconnect the old server.
I need to know if "if" may cause some problems in this rewrite rule.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 158
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready