Nginx: Redirect www to non-www
July 4, 2009 by Mark
Filed under Tips & Tricks
Method 1
Open your nginx.conf and add the following configuration inside your server {} configuration.
if ($host = 'www.domain.com') {
rewrite ^/(.*)$ http://domain.com/$1 permanent;
}
Enable OSWallpaper SEO URLs on Nginx
May 29, 2009 by Mark
Filed under Open Source Software
First enable the clean url by editing config.php (inside includes folder).
//enable mod rewrite urls. 0=disabled, 1=enabled for SEO Friendly URLS $Gbl["ManualModRewrite"] = 1;
The original rewrite rule (Apache) for the script are as follows :
RewriteEngine On #PAGES RewriteRule ^([^/]*)/$ index.php?p=$1 [L] # CATEGORY RewriteRule ^([^/]*)/([^/]*)/$ index.php?p=$1&i=$2 [L] # CATEGORY PAGES RewriteRule ^([^/]*)/([^/]*)/([^/]*)/$ index.php?p=$1&i=$2&pg=$3 [L]
Wordpress Permalinks on Nginx
May 28, 2009 by Mark
Filed under Open Source Software, Tips & Tricks
First open your nginx configuration file.
nano /etc/nginx/nginx.conf
But if you set up a virtual host, you should open the virtual host configuration for the host where you install wordpress. If you are using Debian, the configuration files is located at /etc/nginx/sites-available/. The following command should do that.
nano /etc/nginx/sites-available/example.com
Nginx : Rewrite Rule for Wallpaper Site Creator
May 27, 2009 by Mark
Filed under Open Source Software
Nginx is a lightweight web server and mail proxy server. It was written by Igor Sysoev. Compare to Apache web server, nginx uses less resources. Beside that nginx configuration is pretty simple and easy to understand. If you using Apache and want to switch to nginx. The only thing that you should take care is your rewrite rule. As you know nginx doesn’t support .htaccess, you have to completely rewrite all of yours rewrite rule. But today I will share my rewrite rule for Wallpaper Site Creator script.


