The following is a web design question for the gurus of Apache server:
One of the most common ways people find my blog is through Google Image Search. It has taken the keywords used to tag my images, as well as the pagerank of the site, and made me a prominent hit for many search terms. The trouble is, when I moved to WordPress, I broke all the links. They have not yet grown back.
Most of the hits are for archive pages for the old blog. For example, someone looking for photos of Oxford might be sent to:
http://www.sindark.com/archive/2006_01_01_sibilant_archive.html
Now, that page still exists. It is at:
http://www.sindark.com/blogger/archive/2006_01_01_sibilant_archive.html
Ideally, the person should be sent to the new post page in the WordPress architecture, but sending them to the new location of the Blogger archive page is better than dumping them into a 404 File Not Found screen.
How can I edit my htaccess file so that anyone looking for:
Xyear_Xmonth_Xday_sibilant_archive.html
will be sent to
/blogger/archive/Xyear_Xmonth_Xday_sibilant_archive.html
Of course, this is a temporary fix until Google finally understands the new architecture of my site.
This is now an AskMeFi post. I am getting my $5 worth.
RTFM and stop capitalizing off the superior knowledge of well-meaning strangers.
Working with htaccess is beyond what my brain can manage at the moment. I will take another stab at it tomorrow.
Try using a permanent redirect rather than just rewriting. How about something like this as the first rewrite rule in .htaccess?
RewriteRule ^archive/([0-9]{4}_[0-9]{2}_[0-9]{2}_[a-z0-9_-]+\.html)$ /blogger/archive/$1 [R=301,L]
(I’ve not checked or tested that so there may be mistakes)
I have added that code to my htaccess file and it seems to work. As always, please report any errors to the bug thread.
Stupid htaccess tricks: useful.