htaccess syntax is tricky


in Geek stuff, Internet matters

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:

Now, that page still exists. It is at:

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:


will be sent to


Of course, this is a temporary fix until Google finally understands the new architecture of my site.

{ 6 comments… read them below or add one }

Milan September 18, 2006 at 10:11 pm

This is now an AskMeFi post. I am getting my $5 worth.

B September 18, 2006 at 10:29 pm

RTFM and stop capitalizing off the superior knowledge of well-meaning strangers.

Milan September 19, 2006 at 8:11 am

Working with htaccess is beyond what my brain can manage at the moment. I will take another stab at it tomorrow.

MeFi September 20, 2006 at 8:16 pm

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)

Milan September 24, 2006 at 9:55 pm

I have added that code to my htaccess file and it seems to work. As always, please report any errors to the bug thread.

Milan November 28, 2006 at 6:14 pm

Leave a Comment

Previous post:

Next post: