Jump to content

Recommended Posts

Posted

Hi everybody-

 

After a couple of hours of tinkering with a confusing loop and some SQL, I have put together a script that generates a whole slew of redirects to direct my old Movabletype addresses to my new Textpattern addresses (based on matching titles from the two databases). What I essentially have now are about 300 lines like this:

 

>Redirect /archives/000107.html http://www.schussman.com/article/418
Redirect /archives/000108.html http://www.schussman.com/article/419
Redirect /archives/000011.html http://www.schussman.com/article/336
Redirect /archives/000113.html http://www.schussman.com/article/420

 

I haven't added these to my .htaccess yet because I need to pare out a few duplicates first, and I'm sort of curious about performance. Are all those redirects, plus all the spam referrer blockers, plus whatever else ends up going in there, going to cause any noticable cut in speed? It would be a neat trick to automatically redirect the MT addresses, but I'll reconsider if it will cause a performance hit.

 

-Alan

Posted

I don't believe 300 lines will be a significant performance issue. If your site was rather high volume, then it might not be the best to them all in there, but for a typical site I imagine it would be just fine.

 

All of those rules are operating on the request so they aren't "expensive" operations (that is, they are not resource intensive).

  • 2 weeks later...
Posted

In followup to my redirect question, here's another small issue I'm having. The redirects are working great, but I'm seeing some 404 errors in my stats for URLs like /archives/000341.html%201. Now, any link to /archives/000341.html gets redirected appropriately, but with the %201 appended, browsers get a 404.

 

I wonder if I could use rewrite to eliminate anything after the .html extension -- would the redirect rules then get applied properly? I tried this line

>RewriteRule   ^/archives/(.*)\.html $1                           [L]

thinking that I could match the filename up to the end of the .html extension, but it didn't seem to work. (And I'm not even sure if that's the right style of regexp.)

 

Suggestions?

 

(Edit: Corrected an obvious typo in the rewriterule, but still no love from apache.)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...