Forum Moderators: phranque

Message Too Old, No Replies

Best redirect to use

Changing file names..how to redirect to new pages?

         

madmatt69

6:54 pm on Jun 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi everyone,

Have an noob question. I just changed the file names on one of my sites from old 123.htm names to seo friendly keyword-keyword.htm names. Problem of course is tha the old files are already indexed.

How do I set it up that if someone goes to the old file names through google or whatever they get sent to the new page, and at the same time have SE's phase out the old pages and list the new ones?

I've heard of 301 and 302 redirects but really have no clue which one to use or how.

Any suggestions? Thanks!

jdMorgan

2:24 am on Jun 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Definitely use a 301, since the change is permanent, and you want the SEs to update the URLs in their listings.

Your choices depend on whether you have access to the server configuration, or only to .htaccess. If you have config access, you can use mod_rewrite's RewriteMap directive to make use of a "table" to translate the URLs from old to new. Otherwise, you can use either the RewriteRule directive in mod_rewrite [httpd.apache.org] or one of the Redirect directives in mod_alias [httpd.apache.org] and do the redirects one URL at a time, or by subdirectories if they are well-organized.

Jim

madmatt69

5:30 am on Jun 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Jim,

Thanks for the response!

I've got .htaccess access for sure, but I'm really not sure how to use that directive. The pages are well organized, and thankfully its not a large site (only about 15 pages).

Do you have a solid example of how I would rewrite a URL using Alias or mod_rewrite?

How long should I keep the 302 in place? I'm assuming a couple months at least to be sure.

Thanks again for the help!

jdMorgan

5:48 am on Jun 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried a search? This thread [webmasterworld.com] contains several examples.

... and then there's our required-reading list: ;)
Apache mod_rewrite documentation [httpd.apache.org]
Apache URL Rewriting Guide [httpd.apache.org]
Regular Expressions Tutorial [etext.lib.virginia.edu]

Jim

[added] and that's a 301, not a 302. Make sure it's a 301, or you will cause yourself serious grief. Keep it in place for a year, at least (I keep mine until I haven't seen anyone use the old URL for a year, actually). [/added]

Robert Charlton

6:34 am on Jun 18, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I just changed the file names on one of my sites from old 123.htm names to seo friendly keyword-keyword.htm names. Problem of course is tha the old files are already indexed.

Matt - Not exactly responding to your question, but my feeling is that keyword-keyword.htm names really don't do anything for search, but they do look spammy to both users and search engines. Not that engines penalize for them, but I'm sure they do send up a flag. On the other hand, 123.htm is not a particularly user-friendly name.

A question you might consider is whether you have any deep links to any of these pages, how many of these pages are indexed, and how well they are ranking.

If they have inbound links, you definitely want to redirect, using 301s. If not, and if they are not a major source of traffic, you might just want to change the names and let the old pages disappear and the new ones get reindexed. I changed a page name in Google a short time ago... did not do a redirect... and the page was back and ranking in less than a couple of weeks, if even that long, under the new name. But that wasn't the whole site... it was just one page.

madmatt69

4:28 pm on Jun 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for all that info guys.

Now, I agree that "red-widget-cheap.html" is spammy looking, but right now most pages are generic names, and some like "widgeta.html". Instead of that I'd rather have
"red-widget.html".

That's not too spammy looking or anything is it? I figure it's more usable and might help, even if slightly, in the serps.

I'll give it a shot!

Robert Charlton

5:05 pm on Jun 18, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Instead of that I'd rather have "red-widget.html".

That's not too spammy looking or anything is it?

By itself, no.... It depends on whether you have hyphens in your domain name too.

If it were widget-world.com/red-widget.html, I would drop the hyphen in the page name and call it "redwidget.html". In the cosmic scheme of things, probably not a huge concern either way.

MichaelBluejay

1:39 am on Jun 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Just wanted to chime in to say that 301's did not preserve my PageRank, or my SERPs. It's no big deal, I know they'll be back up eventually, but I definitely went to a white bar for PR on the pages I moved, and it's been that way for over a month now, I think. I used the standard code, you know:

Redirect 301 /widget20.html [example.com...]

madmatt69

4:53 pm on Jun 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have your new pages been indexed?

MichaelBluejay

5:34 pm on Jun 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Um, they're not "new" pages, to me they're "moved" pages.... And yes, they're indexed at their new locations (or at least the first one I checked is -- I didn't check them all), and it's got a white PR bar.

madmatt69

5:39 pm on Jun 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmm. I was thinking of doing this on a larger site that relies heavily on the se's but I don't want them to loose their page rank. It could be that Google just hasn't updated the toolbar with the new rank, but the rank is still there?

MichaelBluejay

1:57 am on Jun 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I doubt it, since my SERPs rankings went out the window along with my PR. And they were pretty good, too.