« WordPress installation - Error establishing a database connection | Home | How to drive more traffic to your website? »

WordPress - Rails - Litespeed

By Nick | March 20, 2007

Pretty urls these days are pretty important if you want a decent ranking in Google. In order to get pretty url’s enabled in WordPress, you have to add some rewrite rules. All my WordPress files are located in the /public/blog directory of my Rails project. You shouldn’t add your rewrite rules to .htaccess as is suggested in the WordPress admin interface. Instead you have to add it to your virtual host in Litespeed. Add the following rewrite rules to Litespeed:

RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_URI} ^/blog.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]

And now all your blog posts have pretty urls.

Topics: Rails, WordPress, Litespeed |

Comments