Welcome! Log In Create A New Profile

Advanced

Rewrite if directory doesn't exist

Posted by 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.
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: 90
Record Number of Users: 5 on May 17, 2013
Record Number of Guests: 138 on May 16, 2013
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready