WordPress.org

Ready to get started?Download WordPress

Forums

coming from Moveable Type (26 posts)

  1. Laughinglizard
    Member
    Posted 10 years ago #

    @atmasphere: I did not see permalinks to your entries. The only permalinks I found were the category permalinks which you could easily redirect using a modified .htaccess file. G****e is very good at understanding and following redirects and relinkage.
    Very interesting blog, BTW

  2. atmasphere
    Member
    Posted 10 years ago #

    I've got permalinks on the MT site ... example - http://www.atmasphere.net/mt/archives/006882.html
    If you could help me better understand how to redirect through htaccess, would greatly appreciate it.
    I guess the best way to do this is to leave the MT site and redirect to WP right?
    Glad you like the site.

  3. Laughinglizard
    Member
    Posted 10 years ago #

    :) That should be really interesting because of the fragmented nomenclature of your MT. I would suggest running both in parallel till the search engines have picked up enough of your WordPress blog. Good luck!
    Here are some good .htaccess resources:
    http://www.javascriptkit.com/howto/htaccess.shtml
    http://wsabstract.com/howto/htaccess.shtml

  4. Alex King
    Member
    Posted 10 years ago #

    The 1.2 alpha code includes a field called 'post slug' that could be used to match your MT post IDs. Of course, 1.2 isn't quite ready yet and you'd need to write a script to populate that field...
    You could also maintain an internal reference table and add code at the top of index.php to match (translate) based on that table.

  5. atmasphere
    Member
    Posted 10 years ago #

    Looking at http://wsabstract.com/howto/htaccess7.shtml
    I found this :

    htaccess uses redirect to look for any request for a specific page (or a non-specific location, though this can cause infinite loops) and if it finds that request, it forwards it to a new page you have specified:
    Redirect /olddirectory/oldfile.html http://yoursite.com/newdirectory/newfile.html
    Note that there are 3 parts to that, which should all be on one line : the Redirect command, the location of the file/directory you want redirected relative to the root of your site (/olddirectory/oldfile.html = yoursite.com/olddirectory/oldfile.html) and the full URL of the location you want that request sent to. Each of the 3 is separated by a single space, but all on one line. You can also redirect an entire directory by simple using Redirect /olddirectory http://yoursite.com/newdirectory/
    Using this method, you can redirect any number of pages no matter what you do to your directory structure. It is the fastest method that is a global affect.

    I've got close to 2000 posts ... do I have to do that for each one? It's not clear how redirecting the directory works... as the numbers will be different on the two systems.

  6. atmasphere
    Member
    Posted 10 years ago #

    I am still working this through how exactly this will work in my situation.
    One post I have :
    http://www.atmasphere.net/mt/archives/006882.html
    will correspond to either:
    http://www.atmasphere.net/wp/archives/1850/
    or
    http://www.atmasphere.net/wp/archives/2004/03/27/on-microsofts-xna-play

    Can anyone tell me what the correct way to redirect this might be? As I previously mentioned I have close to 2000 posts so I need to figure out a way to dynamically figure out where to send the visitor of the old system.
    One thing I suppose I could do would be to move the new blog to /mt from /wp which would keep the site the same. Or I can bite it and lose some fantastic G**gle action and just keep everything in wp.

  7. Alex King
    Member
    Posted 10 years ago #

    I think you're going to need to go the internal reference route. Here are the steps I'd take:
    Create a lookup table that holds the IDs of your MT posts and the matching URL in WP.
    Create a wp-redirect.php file that we put in the mt/ directory (perhaps in the mt/archives/ directory) and a mod_rewrite rule that take your permalink URL:
    http://www.atmasphere.net/mt/archives/006882.html
    and changes it to:
    http://www.atmasphere.net/mt/wp-redirect.php?p=006882
    Then the wp-redirect.php page looks up the ID of the post in the internal reference and redirects the user to the post in WP, sending a 301 (permanently moved) header at the same time (Google picks this up too).
    I'll help you with this if you like - sounds like a useful bit of code for people who want to switch.
    As a side note, this well illustrates the reason you should name your web site directories based on function, not the software running behind the scenes. You could kept a /blog/ or /journal/ URL, but a /mt/ URL is somewhat meaningless now. :)

  8. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    I was thinking something very simlar to what Alex said, but one that redirected using something other than the MT internal IDs, which are (at best) unreliable.
    The ideal mt-redirect.php script:
    * Takes the parameters of year, month, day, time, title.
    * Drills down using those parameters to find a post that is the best match
    * Call get_permalink() for that post ID and send a 301 permanent redirect.

  9. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    Why would you only have the MT ID? Use MT to do One Final Publish, and have the individual entry templates redirect (or pass variables to a function) that sends the 301 header.

  10. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    I also remember seeing some instructions about using an MT template to write an .htaccess file that handled redirects. We could create an MT template that did something like that.

  11. Alex King
    Member
    Posted 10 years ago #

    You'd only have the MT post ID if you were using mod_rewrite from the incoming URL.

  12. Alex King
    Member
    Posted 10 years ago #

    I agree, your approach is better. I've been working on it.

  13. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    Awesome. :)
    This will be a great addition.

  14. atmasphere
    Member
    Posted 10 years ago #

    In my case it replaced the individual archive - should have mentioned that

  15. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    Here's a trick so you don't have to rename everything from .html to .php, put this in your .htaccess:
    AddType application/x-httpd-php .html
    Then all your .html pages will be parsed by PHP. Cool, eh?

  16. Alex King
    Member
    Posted 10 years ago #

    Yikes that code didn't come through very well did it? I'll make it available on my site...

  17. atmasphere
    Member
    Posted 10 years ago #

    sorry about the code ... did not work that well at all.
    I like that fix for .htaccess, but already did it the other way so the pages are there. great for the next person though!
    I am working on the .htaccess stuff now which will redirect an incoming link for a .html page to the .php version as they both live thanks to my over-building in MT. This should push the search and external links I get right into WP which will be most excellent.

  18. Alex King
    Member
    Posted 10 years ago #

    why don't you edit your previous post and remove the code, I've posted it for download on my site:
    http://www.alexking.org/blog/2004/03/29/redirecting-mt-entries-to-wp/
    If you use the PHP template, publish it as .html and make the change Matt is suggesting to your .htaccess you should be fine. No need for a .htaccess redirect.

  19. atmasphere
    Member
    Posted 10 years ago #

    RedirectMatch (.*)\.html$ http://www.atmasphere.net/$1.php
    is what I was given from Pair Tech support and it does in fact redirect to the .php page on my site ... just on the old page. Is there a way now to get that page to read the template we've been discussing above?
    Almost completely there!

  20. atmasphere
    Member
    Posted 10 years ago #

    TOTALLY WORKS!!!
    I used the .htaccess as listed above, then the newly added 301 redirect page from Alex and my old hits through google and others seem to be redirecting to my wp url right to the entry!!
    Awesome!!

  21. atmasphere
    Member
    Posted 10 years ago #

    How did you set up your WP site? What kind of URL did you apply?

  22. DarthVOB
    Member
    Posted 10 years ago #

    I figured it out.
    In WP, it seems that one has to enable the Permalink Structure, "/archives/%year%/%monthnum%/%day%/%postname%/", I did not do that to answer atmasphere's question.
    Then you paste the code generated to your .htaccess file in your ROOT directory. Also paste the "AddType..." in the .htaccess file.
    The mt-wp-redirect-301.php file is still in the archives dir.
    Great hack! Thanks.

  23. ADPR
    Member
    Posted 10 years ago #

    Don't suppose anyone has worked out a way to do this for Radio Userland blogs?

  24. Mark (podz)
    Support Maven
    Posted 10 years ago #

    If a search here throws up nothing, I'd start a new thread about R-Userland.

  25. richards1052
    Member
    Posted 9 years ago #

    I'm not find the code that Alex refers to in his post above at his site. Can anyone help me locate it. I'm tearing my hair out trying to use mod_rewrite to redirect & convert my .html Typepad (like MT) links to good WP links.

    I'd even be willing to pay someone who'd work through this with me (though my situation is a bit diff. because I don't want to maintain my TP site--I'd like to take it down & use domain forwarding & htaccess to get the old links converted to WP.

  26. Alex King
    Member
    Posted 9 years ago #

    The MT to WP code is there, look a little harder (when the server comes back, data center under DDoS right now). :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.