Wordpress, Mod_Rewrite, Search Engine Friendly URLs and NetFirms.com

I recently switched my hosting to NetFirms, as they are one of the few Canadian web hosting companies which allow you to host a number of domains on a single shared hosting account for free.

Netfirms does have its weaknesses though. Specifically, their mod_rewrite implementation is somewhat funky, resulting in almost every script needing a rewritten .htaccess file to get search engine friendly URLs working properly.

One script which has problems with Netfirms is Wordpress. If you are a Netfirms customer and can not get your Wordpress search engine friendly URLs to work properly, give the following .htaccess file a try

# BEGIN WordPress Netfirms HTAccess


RewriteEngine On
RewriteBase /

#Forward domain.com to www.domain.com
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

#Setup Wordpress Rewriting
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index.php
RewriteRule (.*) index.php/$1 [L]

# END WordPress

One weakness in the above .htaccess is domain.com/index.php is not automatically forwarded to domain.com/, which is important to make sure all pagerank is focused at a single location. I will be addressing this in some future post :)

Comments

Glad I could help :)

Thank you so much! I was starting to think of switching host but then I came upon your post. It really works fine and it worth the effort. I don't care for the index.php stuff as long as it works. ;)

Thank you!

Nicolas - webzyk.com

Sorry but your modified .htaccess file does not work with me.
It says:
Not Found
The requested URL /hello-world/ was not found on this server.

I haven't tried setting up Joomla, but got Drupal working on Netfirms - strangely enough all it required was manually enabling SEF URLs via modifying the SQL value manually (no .htaccess changes or anything!)

That being said, I've discovered many scripts just "don't like" Netfirms implementation of Mod_rewrite.

I just moved my hosting to netfirms as well. I'm trying to move my Joomla sites but all the sef urls have died. Your post doesn't quite help my situation but it's a step in the right direction to know other users are having this problem.