Welcome! Log In Create A New Profile

Advanced

Need Help Converting .htaccess to Nginx Configuration File

Kevin Yusharyahya
January 05, 2010 12:38AM
Hi all,
I just moved my site from an Apache-based webserver into a Nginx-based
webserver. As a result, all of my site's permalinks are broken. Can
anyone help me convert my .htaccess into Nginx configuration files?
Here's my .htaccess - for your information, I'm just running a simple
WordPress site. The .htaccess is on /, not on some /dir/.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

I read some articles in the web and after trying to convert it myself
here's what I get.

if (!-f $request_filename){
set $rule_0 1$rule_0;
}
if (!-d $request_filename){
set $rule_0 2$rule_0;
}
if ($rule_0 = "21"){
rewrite /. /index.php last;
}

Is that right? Where should I put that? In
/usr/local/nginx/conf/nginx.conf? I have three sites running in three
domains in the server and I just want this to run at one domain.
--
Posted via http://www.ruby-forum.com/.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Need Help Converting .htaccess to Nginx Configuration File

Kevin Yusharyahya January 05, 2010 12:38AM

Re: Need Help Converting .htaccess to Nginx Configuration File

edogawaconan January 05, 2010 01:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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