Forum Moderators: phranque
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]
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
[edited by: jdMorgan at 8:43 pm (utc) on May 15, 2009]
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?
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