Wordpress plugin: Permalinks Moved Permanently

Installing PHP GD support on OS XIf you just migrated your Wordpress blog from one permalink structure to another, and you don’t want to lose the traffic that accesses your blog through the old permalinks, this is for you.

Right before the old permalink generates a 404, this simple plugin grabs the slug from the end of the request and checks if there’s a post with this slug living somewhere else on your blog. If so, it will generate a “301 Moved Permanently” error, and forward your user to the new location of your post. It’s simple, but effective.Installation:

  1. Download the plugin.
  2. Upload the plugin to your wp-content/plugins directory.
  3. Activate the plugin.

That’s it, enjoy.

Tags: , , , , ,

84 comments on “Wordpress plugin: Permalinks Moved Permanently”

  • DG

    July 31, 2007 (12:14 am)

    Sound nice and cool, it’ll be quite handy, if some one has changed URL more than once.

    DG…
    http://www.ditii.com

  • Pingback by Wordpress 備份與恢復記錄 [JeffHung.Blog]

    [...] 來連,就要自動用 HTTP status code 301 Moved Permanently 轉址到新的 permalinks。Permalinks Moved Permanently 這個 wordpress plugin [...]

  • CarpetGuy

    December 25, 2007 (4:44 pm)

    Hello, I upgraded my blog, updated my plugins, and as the link below shows, my permalink structure got changed. I installed your plugin, but that doesn’t seem to work either. The top link is how they were setup, but to get my blog to work at all, I had to change it to the default, the bottom link. Please advise, thanks.

    http://homebrewfanatic.com/blog2/2007/12/24/blogged-by-bad-ben-on-tap-plans-and-smokestack-series/

    http://homebrewfanatic.com/blog2/?p=62

  • Microkid

    December 25, 2007 (5:03 pm)

    Hi CarpetGuy. The reason it’s not working seems to be that the a loop of redirects occurs. Are you using any other redirect-related plugins?

  • CarpetGuy

    December 25, 2007 (10:41 pm)

    No, at least I don’t know of any, this all happened after upgrading from WP 2.02 to 2.31 I have even tried disabling all plugins, but nothing helps, what can I look for? There must be something I haven’t found that got changed with the new release, again, thanks

  • Microkid

    December 25, 2007 (10:58 pm)

    What version of my plugin are you running? I remember this problem occuring with an older version.. Current version is 1.1.1

  • CarpetGuy

    December 25, 2007 (11:22 pm)

    I installed your plugin after this all happened, to try and remedy the situation, but I have 1.1.1

  • Microkid

    December 26, 2007 (4:12 am)

    Do your permalinks work at all? Could it be a problem with your htaccess file?

  • CarpetGuy

    December 26, 2007 (7:11 am)

    I have a feeling that you are right, yahoo is my host and you can’t upload any hidden files. Almost all of the links work if you go to the site http://homebrewfanatic.com/blog2/ and then click on a permalink, archive etc. But any of the indexed pages wont work using the changed link system. If yu go back up to those links, you see the difference. I just don’t know what eklse to try, I have uploaded any plugin I could find that might help, such as yours, but nothing works. I really appreciate your help

  • CarpetGuy

    December 26, 2007 (8:39 am)

    Ok, when I go to manage/files and open the htaccess file, it is basically empty! All that is there is this

    # BEGIN WordPress

    # END WordPress

    Is that right? Can you get me the code that goes in there? I have hunted everywhere, but I have only found things to add to it, maybe it should be blank? Does this ring any bells?

  • Microkid

    December 26, 2007 (10:30 am)

    You can find whatever should be in your .htacces under Options>Permalinks in your WP admin panel. So change the permalinks structure, and then copy paste whats on the bottom of the page to your htaccess file.

  • CarpetGuy

    December 26, 2007 (12:32 pm)

    Ok, I will try that. I am going to paste the following between the two tags in my last post.

    # BEGIN WordPress
    /%year%/%monthnum%/%day%/%postname%/
    # END WordPress

    So, now that is what is there, does that look right?

    Thanks for your help

  • CarpetGuy

    December 26, 2007 (12:37 pm)

    nope, that didn’t do it. I have already called my host, they can’t figure it out either, it is amazing, this kind of stuff always happens to me. I guess I am just special…….If you have any ideas, let me know.

    Again, thanks

  • Microkid

    December 26, 2007 (4:26 pm)

    Make sure you have yout permalinks set to “date and name based” and put this in your htacces file:

    # BEGIN WordPress

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

    # END WordPress

    If that doesn’t work, ask your host if mod_rewrite is enabled for your website.

  • CarpetGuy

    December 26, 2007 (11:14 pm)

    Ok, Itried that, it didn’t work. Yahoo is on it and I sent them a link to this page so they can see what we tried. Since Christmas is finally over I am going to see if I can find more at Wordpress again, thanks

  • Microkid

    December 26, 2007 (11:54 pm)

    ok good luck mate. If it does turn out to be a problem with the plugin please get back to me.

  • CarpetGuy

    December 27, 2007 (1:21 am)

    I bet it is another typical issue with yahoo not allowing any file that starts with a “dot”. I have been searching for answers everywhere, and so far the only advice I have been given consistently is to switch hosts! I have been with yahoo since 2001 and anytime you want to upgrade phpBB, wordpress etc, these problems occur, again thanks for your help.

  • Alexander

    January 22, 2008 (12:14 am)

    Hi.
    First of all, it is very handy plug-in and thank you for doing it.

    I am afraid, I am suffering from the same problem. I changed the structure of the permalinks on my web-site and now http://www.alexandersandler.net/g15dod takes me (and anyone interested) to 404 instead of http://www.alexandersandler.net/stuff/software-projects/g15dod
    And I am not Yahoo subscriber :-) Any ideas?

    Thanks!

  • Microkid

    January 22, 2008 (1:11 am)

    Hi there Alexander!

    Thanks for your feedback. I think I know what’s going on… Your old permalink structure did not contain a category name or anything between your domain and the posts slug. Appearently my plugin doesn’t know how to handle this. See how the plugin does work when u put something in between:
    http://www.alexandersandler.net/foo-bar/g15dod

    I’m pretty sure I can come up with a quick solution. Gimme a day or two and check back here.

  • Microkid

    January 22, 2008 (1:28 pm)

    Alexander,

    I’ve uploaded an updated version here. Can you check if this solves your problem?

  • Alexander

    January 22, 2008 (1:52 pm)

    Hi.

    This version works as expected. Thanks a lot for fixing it!

  • Pingback by Permalinks Moved Permanently_Wordpress plugin

    [...] Plugin Homepage [...]

  • Pingback by Permalinks Moved Permanently: Updated to version 1.2

    [...] Alexanders feedback, I fixed a bug in the WP plugin “Permalinks Moved [...]

  • Pingback by Permalink Migration Redirect for Wordpress Plugins | Sha Money Maker

    [...] Permalinks Moved Permanently by Microkid [...]

  • Innovation Catalyst

    February 4, 2008 (5:14 pm)

    Microkid -

    I think I understand how this works. But over on Wordpress.org they suggested this plugin to solve a problem, and I’m not sure your plugin works this way.

    I am migrating my blog from Wordpress.com to a new server running the latest Wordpress software, via the native export-import functions. This generated two problems:

    1. Permalinks from Wordpress.com blog need to be redirected, but nothing exists to do this automatically

    2. Permalinks for internal links in my posts need to be changed to reflect new permalink structure in new blog.

    Your plugin was recommended to fix Problem 2. I don’t see how this would work, considering the link now points to my old blog’s permalink, unless I delete the old blog. Or would that work with your plugin at all?

  • Microkid

    February 5, 2008 (2:06 am)

    Hi Innovation Catalyst,

    Yes it can help you with at least half of the solution for your second problem. And I know how the fix the other half as well.

    First, you need to change the domain as used in links that are hardcoded in your content. This can be done by either manually going through all your posts, or automatically by firing an SQL query directly at your MySQL database. If you do not have a lot of experience with this, please be very very careful. Make sure you backup everything and test thoroughly afterwards. A single typo can screw up your entire blog, forever.

    I hope you can find a way to directly speak with your MySQL database, perhaps you have a phpmyadmin install on the server you can use. Just, make very very very VERY sure that you know what your doing. If not, consider asking someone more experienced to do it for you. I just want to make sure that you know that I do not take any responsiblity if something goes wrong. And again, make that backup! And make sure it’s an SQL backup, not just a Wordpress backup.

    Anyways, with that out of the way, use this query to change all the references to your old domain in the content of your posts:

    UPDATE wp_posts SET post_content = REPLACE (
    post_content,
    ‘opensourceinnovation.wordpress.com’,
    ‘open-source-innovation.com’);

    Ok, so now all the links in your content will direct to your new sites URL. For instance a link to this article:

    http://opensourceinnovation.wordpress.com/2008/01/22/three-amazing-reports-on-the-state-of-innovation-part-i/

    will now look like this:

    http://open-source-innovation.com/2008/01/22/three-amazing-reports-on-the-state-of-innovation-part-i/

    As you can see however, this triggers a 404. The domain part is OK, but the rest of the permalinks still needs to be fixed.

    And that’s where my plugin comes in. When you install it, right before displaying the 404, it will first check the database for a post that has the slug “three-amazing-reports-on-the-state-of-innovation-part-i”. It will find the post, and redirect the user to

    http://open-source-innovation.com/three-amazing-reports-on-the-state-of-innovation-part-i/

    Which does work.

    Please let me know if this fixes your problem. And congratulations with your very own Wordpress installation. Looks like a great site!

  • Innovation Catalyst

    February 5, 2008 (2:30 am)

    Microkid

    Thanks for the help. Would doing an export from the new blog, creating an XML file, constitute a backup? I can just import it if things screw up, no?

  • Microkid

    February 5, 2008 (2:36 am)

    Hi,

    Yeah I think so. But the problem is that if something goes wrong and you need to replace all the posts, you will have to manually delete everything from your blog first. Otherwise you’ll have duplicate data (posts, pages, comments, etc.)

    When using the SQL backup, you can just drop the entire database and then use the SQL dump to revive it from scratch.

  • Innovation Catalyst

    February 5, 2008 (3:03 am)

    I get this error when I run the query:

    #1054 - Unknown column ‘‘opensourceinnovation.wordpress.com’’ in ‘field list’

    Database intact.

  • Microkid

    February 5, 2008 (3:08 am)

    Seems like the quotes in the query are copy pasted as smart quotes - make sure they are plain quotes.

  • Innovation Catalyst

    February 5, 2008 (3:58 am)

    OK, query ran, executed the edit.

    I uploaded your plugin, activated, but can’t get it to work yet.

    To test, I clicked on this link in an article:

    http://open-source-innovation.com/2008/01/22/three-amazing-reports-on-the-state-of-innovation-part-i/

    and got the 404 message. Here is the page slug for that article:

    three-amazing-reports-on-the-state-of-innovation-part-i

  • Innovation Catalyst

    February 5, 2008 (5:24 am)

    Never mind, working now. Thanks for all your help.

    IC

  • Kosol

    February 18, 2008 (11:03 pm)

    I’ll try for my blog. Thank you.

  • Tom

    February 19, 2008 (12:24 am)

    These issues may be something I haven’t done or haven’t done right . . . but I haven’t a clue how to do it.

    Thoughts?

    Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /home/.sausage/tailspin/undress4success.com/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php on line 696

    Warning: file_get_contents(http://downloads.wordpress.org/plugin/all-in-one-seo-pack.zip) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /home/.sausage/tailspin/undress4success.com/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php on line 696

    Upgrade failed: Could not download distribution (http://downloads.wordpress.org/plugin/all-in-one-seo-pack.zip)

  • Microkid

    February 19, 2008 (9:40 am)

    Hi Tom,

    I’m not sure why you’re asking this here because I believe you are trying to update the All-In-One-SEO-Pack plugin.

    Anyways, the error you posted has to do with All-In-One-SEO-Pack’s auto-update feature. It’s trying to grab an update file from the wordpress site using the file_get_contents function. Normally this function can grab files over the internet but on your webserver this features has been disabled, probably for security reasons.
    So u can either talk to your hosting company or just manually update, the latter probably being the quickest option.

  • Tom

    February 19, 2008 (8:00 pm)

    Yike! Too many hours in front of the tube (er, TFT) friend my brain. I dunno why I posted this here either! But I do appreciate your polite and helpful answer. “Buzz off noob” would have been appropriate under the circumstances..

  • Microkid

    February 19, 2008 (8:32 pm)

    No problem :)

  • Tom

    February 19, 2008 (10:54 pm)

    fried, FRIED!

  • Tom

    February 20, 2008 (12:11 am)

    Now I see why I was here, I have PMP plugin installed but it doesn’t seem to be working. Nuttin’ to do with All-in-one-SEO, you got hit with a ricochet.

    Anyway, the old permalink, now preserved for eternity on some other website is
    http://undress4success.com/2008/02/13/work-at-home-scams/

    But the actual page is now
    http://undress4success.com/work-at-home-scams/

    Those were both copy/paste of actual, so it’s not a typo issue.

    If you go here
    http://www.workwhistle.com/blog/entry/16683/scambusting-work-at-home-opportunities
    and click on the link you’ll see what (doesn’t) happen(s). You get our version of the 404 error, so PMP doesn’t seem to catch it.

    I’m using v1.2, and yes it is activated ;-)

    htaccess looks like this

    # BEGIN WordPress

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

    # END WordPress

    And looks as if it’s date and name based, as you describe above. Buy I’m using just the slug. Is this the root of the problem?

    Thanks for investing your time in this great tool and responding to pleas for help, especially when the problem is probably self inflicted.

  • Microkid

    February 20, 2008 (12:22 am)

    The way you’ve set it up should work. This for instance does work properly:

    http://undress4success.com/blahblahblah/work-at-home-scams/

    What other slug/redirection/permalink related plugins are you using? Perhaps there’s an issue there.

  • Tom

    February 20, 2008 (1:10 am)

    None, sorry to say. Here’s the file list from the plug-in folder. Do you recognize any that may interfere that I’m not aware of?

    adsense-manager
    akismet
    all-in-one-seo-pack
    amazon-showcase-wordpress-widget
    cforms
    enhanced-links
    get-recent-comments
    google-sitemap-generator
    hot-linked-image-cacher
    if-you-liked-that
    permalinks-moved-permanently
    seo-slugs
    simple-tags
    SpreadThis
    subscribe-to-comments
    ultimate-google-analytics
    wassup
    wp-footnotes
    wp-statpress

  • Microkid

    February 20, 2008 (9:23 am)

    Hmm no not really. I don’t know man, could be anything. Are you sure you have the latest version?

  • Tom

    February 20, 2008 (11:29 pm)

    Plug-in page shows v1.2, sure ’nuff.

    Weird.

    But thanks for thinkin’ on it with me.

  • Microkid

    February 21, 2008 (12:12 am)

    I’ll keep an eye out for a solution, I’ll let you know if I find one.

  • Tom

    February 21, 2008 (2:54 am)

    Ah-HAH!

    I think it has something to do with the number of / characters in the permalink.

    Your
    http://undress4success.com/blahblahblah/work-at-home-scams/
    worked but
    http://undress4success.com/blah/blah/blah/work-at-home-scams/
    doesn’t.

    Ring any bells?

  • Microkid

    February 26, 2008 (7:59 am)

    Hmm… it still has to do with some kind of conflict tho. Here, as you can see the plugin should be able to handle it:

    http://www.microkid.net/bla/bla/bla/bla/permalinks-moved-permanently/

    What happens when you deactivate all other plugins installed? Does it work then?

    If it does, activate them again one by one and keep testing the permalinks, and you’ll find out where the problem is.

  • Tom

    February 26, 2008 (9:38 pm)

    Newp. Sadly, and perversely deactivating all plug-ins (except PMP) did solve the problem.

    I’m perfectly willing to admit this problem may be something dumb I’ve done—or not done, so I’m particularly appreciative of your continuing willingness to help solve it.

    Just for good measure I downloaded and reinstalled the plugin. I assume that like the rest of them, it should be in its own folder right, not just sitting there naked in the plugins directory?

  • Tom

    February 26, 2008 (10:32 pm)

    Shees! I can’t write! Let’s try that again . . .

    Newp. Sadly, and perversely, deactivating all plug-ins (except PMP) didn’t solve the problem.

    I’m perfectly willing to admit this problem may be something dumb I’ve done—or not done, so I’m particularly appreciative of your continuing willingness to help solve it.

    Just for good measure I downloaded and reinstalled the plugin. I assume that like the rest of them, it should be in its own folder, not just sitting there naked in the plugins directory, right?

  • Microkid

    February 27, 2008 (8:22 am)

    I think I figured it out. Can you install this version and see if it works:

    permalinks-moved-permanently-2.1b.zip

  • Tom

    February 27, 2008 (3:00 pm)

    Better! It seems to see the slug, and I don’t get the 404 error page.

    But it takes me to the home/most recent post page, not the article with the same slug.

    Progress! Good job!

  • DJSlim

    February 27, 2008 (11:18 pm)

    I have installed and activated the plugin since my permalinks had to change for an unfortunate reason.

    Permalink structure is now

    http://slimtainment.com/idolblog/?p=1210

    Old Structure was

    http://slimtainment.com/idolblog/1210

    The plugin still shows a 404 and redirects to the main index page. any thoughts on this??

  • DJSlim

    February 28, 2008 (12:18 am)

    I figured it out another way without the plugin :)

  • Microkid

    February 28, 2008 (12:40 am)

    Tom - I’m still working on a solution. Just know that it has nothing to do with your settings or anything, there’s a compatibility problem with wordpress 2.3.3 I’m gonna look into it when I get the time.

  • Tom

    March 2, 2008 (1:28 am)

    Great, thanks!

  • Tom

    March 5, 2008 (3:58 am)

    Any progress?

  • Tom

    March 12, 2008 (8:29 pm)

    Bump?

  • William Teach

    April 2, 2008 (2:07 pm)

    Unbelievably awesome plugin, Microkid. I have been looking to change from the numbers based permalinks to word description ones for awhile now, and did not want to make all those old links not work.

    It is really important now, if someone changes, because with 2.5, rather then kicking a 401, or just back to the main page, you get a 500 error.

    Plugin working like a charm. Thanks!

  • Microkid

    April 2, 2008 (2:12 pm)

    Tom - Sorry, haven’t had much time to look into it.. I will soon!

    William - thanks ;)

  • Pingback by WordPress SEO Tipps und Plugins » Beitrag » WordPress Magazine

    [...] Permalinks moved permanently [...]

  • Pingback by Neue Permalinkstruktur @ Dave’s Blog

    [...] und gewächselt. Damit die alten Links aber immer noch funktionieren habe ich das Plugin “Permalinks Moved Permanently” im Einsatz. Das sollte alle Links automatisch weiterleiten (soweit ich getestet habe [...]

  • Wayne

    April 27, 2008 (1:45 pm)

    Before I installed your plugin, I got 302 redirects to my posts from the old /?p=N structure. Turning it on didn’t change that - still 302, not 301. It looks like it never gets to your code. What am I doing wrong here?

  • Wayne

    April 27, 2008 (1:57 pm)

    Never mind - I found another plugin that did what I wanted.

  • Pavel

    April 28, 2008 (7:18 pm)

    Hello!
    I am using a plugin
    /*
    Plugin Name: WP-DownloadManager
    Plugin URI: http://lesterchan.net/portfolio/programming.php
    Description: Adds a simple download manager to your WordPress blog.
    Version: 1.00
    Author: Lester ‘GaMerZ’ Chan
    Author URI: http://lesterchan.net
    */

    After I activated PNP this plugin started to work wrong. The link to download file in this plugin looks like “http://www.exchangerus.ru/download/4/”
    Is it possible to tell PMP don’t process page if reguest is “http://www.exchangerus.ru/download/*”?

  • baron

    May 6, 2008 (5:19 pm)

    hi there .thanks for plugin:

    Does anybody know if tis script is compatible with Wordpress 2.5.1 ?

    Thanks in advance for any help on this!

    best regards

    baron

  • Microkid

    May 10, 2008 (2:24 pm)

    @Pavel

    It seems that the download manager has some strange behaviour. PMP is initiated after a 404 is triggered. Appearently your download manager plugin does the same, although it would make more sense if it used the WP rewrite engine instead.

    @ Tom

    I have a beta version that hopefully solves your problem. Can you please check if it works and let me know? Download it here:

    http://www.microkid.net/software/permalinks-moved-permanently-1.3b.zip

    Thanks!

  • Tom

    May 10, 2008 (6:51 pm)

    Worked!

    Thanks very much for #1 creating the plug-in, and #2 fixing this vexing problem.

    My hero!

  • Microkid

    May 11, 2008 (2:19 pm)

    Excellent, thanks for your feedback.

    I’ll release the new version in the upcoming days.

  • Pingback by “Permalinks Moved Permanently” Wordpress plugin updated

    [...] It has been updated to 2.5 compatibility. Download it here. [...]

  • Pingback by Changing the URL of your WordPress blog | RyanTAdams.com

    [...] plug-ins you have that even remotely depend on your blogs URL. For me, this meant disabling “Permalinks Moved Permanently” and “Hotlink Protection” along with several custom plug-ins I had [...]

  • Walt

    May 19, 2008 (9:42 am)

    Hi. I’m looking for something and I think your plugin fits the bill. But, I just wanted to be absolutely certain.

    My current links structure is

    domain.com/postname

    I want to modify it to

    domain.com/category/postname

    Am I correct that your plugin is the ticket?

  • Microkid

    May 19, 2008 (11:38 am)

    Hi Walt,

    Yeah it works (tested on Wordpress v2.5.1).

  • Shirley

    June 3, 2008 (12:40 am)

    Hi. I’m not sure that I’m doing this correctly. I’ve moved my older website to wordpress.org and I need to have a few links forwarded.
    One of the pages is a direct copy from my old website. I tried typing in the old address to see if it redirects, but it didn’t. I just tried emptying the cache and then pasting the old address directly into the content of the new page and it still didn’t redirect.
    What do you think?

    The old address is:
    http://www.ticktots.com/Site/Gringos_Blog/Entries/2008/1/1_Healthy_for_humans,_deadly_for_dogs.html

    The new address is: http://www.ticktots.com/?page_id=185

    Thanks!
    Shirley

    P.S. all other plugins were inactivated and I’m using wordpress 2.5.1

  • Shirley

    June 3, 2008 (4:08 am)

    OK, I think I’m getting closer. I found out how to change the new permalinks for date and entry title and I’m getting onto the site, but page not found…
    The new permalink is:
    http://www.ticktots.com/2008/02/11/healthy-for-humans-deadly-for-dogs/

  • Microkid

    June 3, 2008 (9:09 am)

    Hi Shirley,

    It appears your old site is not a wordpress site, correct? This plugin only works when you change your permalinks structure in wordpress. But there’s another plugin that helps you to manually map your old links to the new ones, it might be the solution for you:

    http://wordpress.org/extend/plugins/redirection/

  • Shirley

    June 3, 2008 (5:19 pm)

    Thanks! I saw that one earlier but it says that it works up to wordpress 2.3.3 and I have 2.5.1. I’ll try it out anyway. If not, at least yours get to the new website without a 404 or 301 or whatever it is.
    Thanks again!
    Shirley

  • Pingback by Migrate permalink structure | iCalvyn.com

    [...] using “Permalink moved permanently” plugin from Microkid, will solve your problem while you change permalink structure. Example [...]

  • Walt

    June 11, 2008 (8:00 pm)

    Wow. Although I’m not sure how, this worked like a charm. I tried a couple other similar plugins, but they just caused me a lot of headache. Thanks for the great script.

  • Walt

    June 11, 2008 (8:06 pm)

    Uh oh. Spoke too soon. I didn’t test thoroughly enough. I migrated from /%postname to /%category%/%postname. When I try the old permalink style I get a nasty 404 error.

  • Microkid

    June 11, 2008 (8:15 pm)

    Hi Walt,

    Hmmm… that’s odd, it should work. Any other rewrite/permalink related plugins you’re running?

  • Walt

    June 11, 2008 (9:22 pm)

    Can you explain this…? (I swear it’s true!!) I decided to “debug” the plugin in my own plodding way.

    First I added

    echo ’slug: ‘.$slug;

    at the top to make sure that was a valid value. There were some ‘header’ issues, but the slug value looked good.

    So, I went a bit further into the plugin (just before the rewrite occurs) and added

    echo ‘ID: ‘.$ID;

    to make sure it was still on track. Same ‘header’ hiccup, but it had a post ID value.

    Finally, I decided to see what the new permalink value was, so I added

    echo ‘new: ‘.the_permalink($ID);

    right after your code does the get_permalink( $ID );

    Imagine my surprise when it started redirecting properly! I removed that line, it stopped working. I added it back in, it started working again. I removed the ‘new: ‘ from the echo, it stopped working. I added it back in, it started working.

    After trying as many combinations I could think of, I’ve settled with

    echo ‘:’.the_permalink($ID);

    which seems to be the minimum that allows the plugin to work.

    If you can figure out what’s going on, more power to you.

    (In answer to your question, yes I had John’s Redirection plugin going prior to loading your plugin, but I deactivated it while I was testing).

  • Microkid

    June 11, 2008 (9:35 pm)

    Wow, that’s weird.. All I can think of is maybe a problem in the HTTP headers.

    But hey, if it works… :)

  • Walt

    June 11, 2008 (10:15 pm)

    Well, I haven’t upgraded this blog to 2.5 yet. I guess we’ll see what happens when I do that. If it’s something in WP, I guess I’ll find out.

    You don’t suppose it could be a theme issue..? It’s a theme I tried out for this particular blog that’s a bit different than some others I’ve tried

  • Microkid

    June 11, 2008 (10:21 pm)

    What version of WP are you running now?

    After updating, you might get this error:

    “Warning: Cannot modify header information - headers already sent”

    If, so just change the plugin to the original.

    I doubt it has something to do with your theme. What’s different about it?

  • Walt

    June 11, 2008 (10:59 pm)

    2.3.3

    The theme has a bunch of built in functions like a breadcrumb trail, and some “creative” CSS functionality.

Post a comment

(will not be visible)