Search

User login

Poll

What is your favorite DB Server ?:
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
6 + 14 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

My YM

Author Information

sentono
Offline
Last seen: 6 days 17 hours ago
Joined: 09/21/2007

Alexa Rank

Who's online

There are currently 0 users and 8 guests online.
Home
  • warning: Invalid argument supplied for foreach() in /usr/home/wowtutorial/public_html/sites/all/modules/adsense_injector/adsense_injector.module on line 352.
  • warning: Invalid argument supplied for foreach() in /usr/home/wowtutorial/public_html/sites/all/modules/adsense_injector/adsense_injector.module on line 35.

Nginx URL Rewrite for Wordpress

Here is a short tutorial and how-to configure nginx and wordpress to support a permalink.

Login into Wordpress dashboard

First, Login into wordpress admin
ex : http://www.domain.com/wp-admin
input your admin user and password

Click Settings
Click Permalink
Enable "Permalink custom"
Add this to permalink custom

%postname%

Save.

Testing it out.

Open your web browser and input this url
http://www.domain.com  where domain.com is your wordpress default website
Click About Page and you should receive 404 error.

No problem, next we will configure nginx to support permalink.

$pico /usr/local/etc/nginx/wordpress_params.regular

# WordPress pretty URLs:
if (-f $request_filename) {
break;
}
if (-d $request_filename) {
break;
}
rewrite ^(.+)$ /index.php?q=$1 last;
# Enable nice permalinks for WordPress:

error_page  404  = //index.php?q=$uri;
]

### save this file

Edit Nginx.conf Vhost

#pico /usr/local/etc/nginx/vhost.d/wowtutorial.org.conf

### edit few lines below ###

location /
{
root /home/username/public_html/$blog_directory;
index index.php index.html index.htm;
# this is the file you created above, then populated with content
include wordpress_params.regular;
}

### save this file

Restart nginx web server

#killall -9 nginx
#/usr/local/sbin/nginx start

 

 

Comments

Thanks. You saved me an

Thanks. You saved me an headache

Thanks

Thanks, spent the day trying to get this figured out.  Glad I found your post though you may want to delete the "]" after the first code.

 

Thanks again.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Recent comments

Facebook Fans

Sponsors

Online Store

Tag Cloud