Joelika.com

Netfirms Pretty Permalinks Plugin for WordPress Release Extravaganza!

Fear not fellow Netfirms users! I’ve heard your cries and it brings me great joy to release my plugin to enable pretty permalink functionality that the rest of the world seems to enjoy, all without hacking a single line of code! For those of you who can’t wait to get your hands on it, download it here:

Netfirms Pretty Permalinks 1.0 beta 1

Oh yes my friends, to keep on the hip and cool Web 2.0 bandwagon, this is indeed a beta release. Why? Well, I’ve tested it myself on my Netfirms installation with my WordPress setup, but your setup may differ. So hopefully you will take the time to try it out for yourself, and report back here with whether it works or not. That will help me make any changes I need to. My testing environment was WordPress 2.2.3 and WordPress 2.3 on PHP 5. When posting a comment, please list your testing setup as well.

To install, please follow these easy steps:

  1. If you’ve already installed my previous hack, either remove it, or update to the newest version of WordPress (you were looking for an excuse to anyway, weren’t you?)
  2. Make sure your .htaccess file is writeable (unless you have some weird custom rewrite rules you don’t want WordPress to override. Chances are if you have no idea what I’m talking about, you shouldn’t need to do a thing)
  3. If you’ve installed Mark’s plugin to disable canonical urls, deactivate it. This has been rolled into my plugin as well.
  4. Upload `netfirms_permalinks.php` to the `/wp-content/plugins/` directory
  5. Activate the plugin through the ‘Plugins’ menu in WordPress
  6. Choose your permalink structure through the ‘Permalinks’ submenu under the ‘Options’ menu.

For those of you who are curious to what this plugin does, Netfirms (for some reason or another) doesn’t work with the default permalink structure WordPress generates. So this plugin creates new mod_rewrite rules in your .htaccess file that append the post query to the end of index.php as a query string. Then the plugin appends `index.php` to the beginning of each internal WordPress rewrite rule, because when WordPress on netfirms receives the query string, it does so as a REQUEST_URI and not PATH_INFO, and therefore has the `index.php` in it. So we need to add it so WordPress can make the match. Easy as pie.

Special thanks to Wakefield, who posted about the updated forced canonical urls in the new WordPress 2.3 release. You DO NOT need to install the separate plugin to disable the canonical url function. This plugin automatically does this for you. If you want to use it, tough luck because it forces Netfirms into an infinite loop. Bummer.

trackback | permalinkComments Feed

Kristen:

20071012 08:49

Dude, you’re still at it! I stopped by Joelika.com to reminisce of the good ol’ days and things have definitely changed. Keep up the awesome work. Hope all is well!!!

joel:

20071016 10:02

Eh, not at it as much as I was, but still trying! I need to get a new site design up, I’m really starting to hate this one :-p

For some real reminiscing….
http://web.archive.org/web/20011001021848/http://joelika.com/

It was great to hear from you Kristen! Shoot me an email and let me know what’s going on with you!

Alex tabaczka:

20071022 11:08

Thank you very much… I contacted netfirms about adding this plug in to their customer support database. Its a real life saver. Thank you again!

alex tabaczka:

20071023 06:23

Hello Alex,

Thank you for contacting Netfirms.

We appreciate you sending this link to us and we will be adding this plugin and a link to the author’s site to our Support FAQ on creating permalinks with WordPress. We have tested it using both versions of PHP and it works as expected.

Regards,

Dan
Netfirms Inc.
http://www.netfirms.com

There ya go!

joel:

20071023 08:51

Hi Alex,

Thanks for the note, and thanks so much for taking the time to submit that to Netfirms. It really means a lot that the plugin helped you and you wanted to pass it on! 😀

Honestly, I am pretty shocked that Netfirms is going to pick up the plugin, let alone link to my site. I haven’t given them the best press over the past year (but before that, I recommend them to everyone). So we’ll see if they really do link here, or just the page over at the WordPress Plugin Directory.

Anywho, thanks again for leaving the comment, and letting me know that it worked for you, and even for Netfirms IT!

Harsha:

20071025 08:25

Hey I had the same problem with netfirms and permalinks. I tried the plugin but it did not work for me.

I use PHP4 and WordPress 2.3

So I tried the code way. I used the .htaccess file. And then disabled canonical urls by commenting out the last line of code from canonical.php and it worked.

Thanks for the great write up.

joel:

20071025 10:51

Hi Harsha,

Thanks for the report, and sorry the plugin did not work for your setup. Could you provide me with any additional information about the failure (errors, timeouts, etc)?

One thing you may want to try is after installing the plugin, go back into your Permalinks Options page, and just turn off and turn back on your permalinks structure. This will force WordPress to rebuild the rules (the plugin is supposed to do that when it is activated, but maybe it didn’t).

Also, I’ve been toying with the idea of adding in the “RewriteCond %{REQUEST_URI} !index.php” line to the mod_rewrite rules. I’ve never had to use it in my 1+ year of using my hack, but I’ve seen one other person who needed it, and it is mentioned in the Netfirms FAQ section. Then again, I’ve never had my blog in a sub-directory either, so maybe that makes things different.

Harsha:

20071025 12:03

The error was either a “404 Not Found” or “The page isn’t redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete”. I’m not sure which one occurred when I used the plugin. I guess the redirection error is due to the canonical url’s in wordpress 2.3

One thing I wanted to ask – We don’t keep the .htaccess file locked when we use the plugin, right?

And yeh I was getting a 404 if I don’t use the “RewriteCond %{REQUEST_URI} !index.php” line. May be as you say, since I have my blog in a sub directory.

joel:

20071025 12:32

Hi Harsha,

Yeah, definitely sounds like a mod_rewrite rule issue. I was also getting a never ending loop error when I was first writing the plugin for WordPress 2.3, but that’s when Wakefield posted about that canonical URLs, so my plugin disables them by default (there’s actually a handy hook that will do it… those WordPress guys think of everything I swear!).

Correct, the .htaccess file needs to be writable for the plugin to work, because it will inject new mod_rewrite rules from my previous findings.

If you’re feeling adventurous and would like to give the plugin another shot, could you add the following rules into your .htaccess file, lock it down to 444 or something similar, and then enable the plugin? This will tell if the extra rewrite rule is indeed needed for WordPress in a sub-directory. If they are, I will place them into the plugin.


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

Thanks! 😀

Harsha:

20071027 09:23

Its works perfect! I just tested it on my blog. I guess that extra rewrite is required.

At first I did NOT want to ruin my perfectly working blog just for the sake of testing. But then again we wouldn’t be what we are if we don’t do things like that.

Anyways I’ll keep checking for the update. 🙂

joel:

20071028 07:32

Hi Harsha,

I really do appreciate you throwing your blog into the fire just to test the plugin for me! I’ve added that rewrite line into the plugin and updated it on WordPress.org.

Thanks so much again! 😀

Gregor Davidson:

20071029 10:43

You are a lifesaver!!! Worked with like a charm with 2.3.1. Thanks a million bro.

Harsha:

20071030 05:34

Plugin installed and my blog up and running. Great update. Even runs on the WP 2.3.1 to which I’ve recently updated.

mike cupcake:

20080109 08:27

wish I’d found your site two hours ago. thanks for fixing this!

Samual:

20080129 09:32

Holy shit. I just spent 2 hours trying to fix this problem. The funny thing is that I have 3 wordpress blogs on separate Netfirms accounts, and 2 work with my own custom htaccess. I’m not sure why this particular one didn’t.. but your plugin helped. THANK YOU!

I highly suggest NOBODY use Netfirms. I’m switching when my contract runs out. Worthless RoR support (doesn’t support Mephisto Blog), downtime, argh..

chan:

20080201 12:18

thank you!

A77 » Blog Archive » Plugin to resolve the Netfirms’ WordPress Permalinks issue:

20080216 01:32

[…] “majestic”. It worked like a charm without a single .htaccess code change. Thank you Joelika. You made my day […]