Forum Moderators: phranque

Message Too Old, No Replies

Rewrite add subforum

         

CaNNibuZZ

6:47 pm on May 15, 2009 (gmt 0)

10+ Year Member



I want people that visit this page (old indexed page)

example.com/preview/192/example.html

to this page

example.com/preview/videos/192/example.html

how do I do that without SE penalization?

[edited by: CaNNibuZZ at 6:48 pm (utc) on May 15, 2009]

[edited by: tedster at 7:55 pm (utc) on May 15, 2009]
[edit reason] switch to example.com [/edit]

jdMorgan

8:43 pm on May 15, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not sure what you mean by "SE penalization" -- Search engines rarely "penalize" anything, although changing the URL for your page will result in a temporary loss of ranking because it will take time for the search engines to figure out that the page has moved, and to credit the new URL with the ranking of the old one. This is not a penalty, it is just a result of how "the machine" works.

Webmasters tend to want see "penalties" where there are none, instead of investing the time to understand how search engines work or looking for technical or quality-related problems on their own sites.

The simplest solution is to use the mod_alias directive "Redirect."


Redirect 301 /preview/192/example.html http://example.com/preview/videos/192/example.html

Jim

[edited by: jdMorgan at 8:43 pm (utc) on May 15, 2009]

CaNNibuZZ

6:57 am on May 16, 2009 (gmt 0)

10+ Year Member



Ok thanks for that, I need to develop this further now though and I can't get it to work with the following -

Redirect 301 /preview/([0-9]+)/(*.).html http://example.com/preview/videos/$1/$2.html

$1 holds a number of variable length. $2 is supposed to hold a couple of words that are seperated by either a hyphen or space.

I didn't think that having the http://www.example.com/ bit at the start was necessary, is it possible to keep the redirect internal?

jdMorgan

9:43 pm on May 16, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you want to use a regular expressions pattern, then you'll need to use "RedirectMatch"

RedirectMatch 301 ^/preview/([0-9]+)/([^.]+)\.html$ http://example.com/preview/videos/$1/$2.html

See Apache mod_alias documentation for more info.

Do you want search engines to change their listings to use the new URL? If so, then you need an external redirect, as we've discussed here.

If you've simply moved things around inside the server (for organization or convenience) and you want to keep using the old URL, but resolve it to a different filepath, then you'll need to use mod_rewrite to do an internal rewrite instead of an external redirect. See Apache mod_rewrite docs for more info.

Jim

CaNNibuZZ

10:14 pm on May 16, 2009 (gmt 0)

10+ Year Member



That worked perfectly, thankyou for all your help with this.