Google

Question

301 redirect for dynamic php

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 `http://natureinfocus.com/galleries/fauna/insects/moths/adults/Luna_Moth_eye.jpg.html`

New link for zenphoto gallery should be `http://natureinfocus.com/galleries/fauna/insects/moths/adults/Luna-Moth-eye.jpg.php`

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

All Answers

Nice site.

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.

Start or search

Create a new discussion

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

Post type

Subject title

Topic Tags

Select up to 3 tags (1 tag required)

Cloud

Piracy

Security

Apple

Microsoft

IT Employment

Google

Open Source

Mobility

Social Enterprise

Community

Smartphones

Operating Systems

Windows

Mac

Malware

Tablets

Networking

Browser

Hardware

Software

Web Developerment

Linux

Off Topic

Message Body

Track this discussion and email me when there are updates

Please note: Do not post advertisements, offensive material, profanity, or personal attacks. Please remember to be considerate of other members. If you're new to the TechRepublic Forums, please read our TechRepublic Forums FAQ. All submitted content is subject to our Terms Of Use.