Welcome! Log In Create A New Profile

Advanced

port .htaccess to nginx conf

Posted by nexon 
port .htaccess to nginx conf
March 05, 2013 05:25AM
How to port this .htaccess rules to be used on a nginx webserver:
-----------------------------------------------------------------------------
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !index\.php$
RewriteRule ^(.*)$ index.php?q=$1 [L]
------------------------------------------------------------------------------

Thanks, Nexon
Re: port .htaccess to nginx conf
March 05, 2013 06:32AM
I have tried this:
------------------------------------------------------
location / {
rewrite ^(.*)$ /index.php?q=$1 break;
}
------------------------------------------------------

And this:
-------------------------------------------------------
if ($request_filename !~ "index.php$"){
set $rule_0 1$rule_0;
}
if ($rule_0 = "1"){
rewrite ^/(.*)$ /index.php?q=$1 last;
}
--------------------------------------------------------

Not working, code 500, Internal Server Error.

Any comments?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 52
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready