301 redirect for dynamic php

By NaturalEnquirer ·
I hope someone with rewrite expertise can help me as I don't know how to do this - I don't want to lose my existing google index entries!

I have old gallery2 site with links that were ``

New link for zenphoto gallery should be ``

So I tried adding in root .htaccess file:
Redirect 301 /galleries/fauna/insects/moths/adults/Luna_Moth_eye.jpg.html
which does at least let Google redirect the link, but now the link displayed on the page is:

I'm thinking I should be using Rewrite Rule, but I don't have the knowledge on know how to write the rule - I've made some attempts but can't get it to work.

I'm asuming I should put the .htaccess in the root and not the zenphoto directory?

Could someone please give me an example for this file? Then I think I can fix the oher links.

I'm really struggling with this!

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Nice site.

by seanferd In reply to 301 redirect for dynamic ...

OK, I don't know about PHP, butif this is your site, why would you want Google to redirect?

As you see now, it is throwing a 404, which is likely why it is defaulting back to the general gallery.

The 301 should be local, and not involving Google. I take it the redirect is supposed to search for the file name, via Google site search, and find the file, then produce the link. I would suggest simply fixing the links, or keep the redirect internal.

The actual redirect link does work, it just shows the redirect. But the old site is throwing a 404 instead of doing the redirect. And it doesn't really matter (I think) whether it says .html or .php at the end. Either works, but the redirect is not.

You may need to adjust the behavior of the 404.

Related Discussions

Related Forums