Forum Moderators: phranque

Message Too Old, No Replies

redirecting pages after redesign

         

mattennant

12:10 am on Aug 10, 2008 (gmt 0)

10+ Year Member



hi there

i'm redesigning a clients website and keen not to loose page rankings.

i'm going to redirect the old pages to the relevant new ones using htaccess

there's a mass of pages.

my question is do i need to redirect each page individualy of is there a nice shortcut i can add.

this is what im thinking, rather than

Redirect 301 /stansfield.htm http://www.example.co.uk/property.php?property_id=118
Redirect 301 /stansfield1.htm http://www.example.co.uk/property.php?property_id=118
Redirect 301 /stansfield2.htm http://www.example.co.uk/property.php?property_id=118
Redirect 301 /stansfield3.htm http://www.example.co.uk/property.php?property_id=118

can i have something like

Redirect 301 /stansfield([a-z\-]+).htm http://www.example.co.uk/property.php?property_id=118

that wasn't happening, but i'm hoping i'm not far away

cheers

mat

[edited by: jdMorgan at 2:03 am (utc) on Aug. 10, 2008]
[edit reason] example.com [/edit]

jdMorgan

2:04 am on Aug 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd suggest you leave the URLs as they were if you don't want to lose ranking. You *will* lose ranking for at least a short period of time by changing the URLs, and those new URLs with query strings likely won't ever do as well in the search results as static URLs would. Do as you wish, but I would never switch a client to dynamic URLs from static; Look around in the forums here, and you will see that everyone is putting a lot of effort into doing exactly the reverse.

If you're intent on doing this, then see the Apache mod_alias RedirectMatch documentation, or use mod_rewrite. Either will reduce the number of external redirects you'll have to do.

But for your next project, bear in mind that just because you change filenames does not mean that any of your URLs need to change -- they don't. Take a look at doing URL-to-filename inernal rewrites using mod_rewrite, rather than URL-to-URL external redirects. Also have a look at this short paper [w3.org] by Sir Tim Berners-Lee, inventor of the hyperlink.

Jim

mattennant

7:41 am on Aug 10, 2008 (gmt 0)

10+ Year Member



Thanks jim

That's an interesting paper and great advice -made me think over my morning coffee

editsha

7:54 am on Aug 13, 2008 (gmt 0)

10+ Year Member



I completely agree with Jim,

But in case its the business need to get this migration done ... you can use the dot config file in php to change all dynamic url to static (friendly url)

Example:http://www.somesite.co.uk/site.php?section=books&subsection=architecture
to
[somesite.co.uk...]