Forum Moderators: phranque

Message Too Old, No Replies

help: need mod_rewrite rule to call images

images using my old image filenames are not displaying in my blog

         

richards1052

10:06 pm on Jun 22, 2005 (gmt 0)

10+ Year Member



I used to have a Typepad blog. Now, I've migrated to WordPress.

At one time I had a mod_rewrite rule in the htaccess file of my WordPress installation that converted filenames & paths of those images I uploaded in my old Typepad blog to an image filename/path recognized by WordPress. Now, somehow that rule has disappeared from my htaccess file. Here's a description of the problem. Anyone who can suggest a solution pls. do. I'm no expert at mod_rewrite or htaccess & this one escapes me. Also, if you'd like to see the actual hyperlinks so you can better diagnose what's going on send me a PM & I'll send them to you.

In order to maintain continuity bet. the Typepad & WordPress installations, when I did the post & image import into WP, I mirrored the same foldername & filepath/structure for WP as I had in TP. A WP user also created mod_rewrite rules that converted the old Typepad post link format into a WP link format in order to allow visitors using old links to reach those posts in the WP blog. He also wrote rules regarding my old image files.

I may've accidentally wiped out those mod_rewrite rules. So he rewrote them & now the links to the old posts are working fine.

But all my old images have disappeared (I believe because he may've forgotten to readd the image rewrite rules). All I see on the blog display pg. are hyperlinks with the filename.

Here's what the post link for a non-displaying image link looks like :
www.mysiteurl.com/tikun_olam/2005/05/marcy-silverste/

where you'll see the hyperlink for this image (& an error msg. if you'd try to follow it):
www.mysiteurl.com/tikun_olam/images/tilliesilverstein8kids_tp_1.jpg

I'm guessing that this was the old Typepad filepath. When the WP user set up my WP installation he DID create a tikun_olam/images folder and this image IS in that folder. But it won't display.

It appears that the image is also located at
www.mysiteurl.com/photos/uncategorized/tilliesilverstein8kids_tp_1.jpg
and this link WILL display the image. But all my old image links have the tikun_olam/images filepath structure & I need to figure out a way to get them to display as well.

The default image upload filepath I'm currently using is:
www.mysiteurl.com/photos/uncategorized/gees_anna_young_strips_talk_of_nation.jpg

Can anyone tell me if there's a way you can think of to fix this? I don't know if it requires mod_rewrite rules or something much simpler (which is what I'm hoping).

jd01

9:59 pm on Jun 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For some reason the images were being appended as a query string, not in the .htaccess

Fixed with:

RewriteCond %{QUERY_STRING} ^/([^.]+)(\.jpg)
RewriteRule ^\.shared/image.\html$ /%1%2 [R=301,L]

Justin