Welcome! Log In Create A New Profile

Advanced

Converting Rewrites to Nginx

March 18, 2014 08:05AM
I have been trying to convert the following htaccess rules to nginx with no
luck.

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

I've tried:

location / {
if (!-e $request_filename){
rewrite ^(.+)$ /index.php?url=$1 last;
}
}

and I've also tried:

location / {
try_files $uri $uri/ /index.php?url=$1 last;
}

None seem to work. Any help with this is greatly appreciated.
SubjectAuthorPosted

Converting Rewrites to Nginx

parkerjMarch 18, 2014 08:05AM

Re: Converting Rewrites to Nginx

Miguel ClaraMarch 18, 2014 09:52AM

Re: Converting Rewrites to Nginx

parkerjMarch 18, 2014 10:54AM

Re: Converting Rewrites to Nginx

parkerjMarch 18, 2014 03:10PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 101
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 229 on August 01, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready