Welcome! Log In Create A New Profile

Advanced

Re: rewrite rules

June 01, 2009 03:30AM
On Mon, 2009-06-01 at 07:30 +0200, Tomasz Pajor wrote:
> Hello,
>
> RewriteEngine On
> RewriteCond %{REQUEST_FILENAME} -s [OR]
> RewriteCond %{REQUEST_FILENAME} -l [OR]
> RewriteCond %{REQUEST_FILENAME} -d
> RewriteRule ^.*$ - [NC,L]
> RewriteRule ^.*$ index.php [NC,L]
>
> Can anybody point me out how should this rules look like for nginx,
> thanks in advance!

I don't think you'll need any rewrites in Nginx. It appears that the
above basically says, "if the file exists, serve it, otherwise hand the
request to PHP". In Nginx that equates to:

location / {
root /path/to/docroot;
expires 30d;
index index.php;
error_page 404 = index.php;
log_not_found off;
}

location \.php$ {
# ... usual PHP FastCGI stuff
}

Regards,
Cliff
Subject Author Posted

rewrite rules

Tomasz Pajor June 01, 2009 01:30AM

Re: rewrite rules

Cliff Wells June 01, 2009 03:30AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 165
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