0

How can I modify my .htaccess to direct users attempting to view old page URLs on our website to the new version? For example:

Old non-functioning URL: www.mysite.com/128

New URL: www.mysite.com/this-is-the-new-location/321

I would like www.mysite.com/128 to show the new page content.

JoeW
  • 578
  • 1
  • 10
  • 29
  • you want to redirect to the page or show the content of `this-is-the-new-location/321` with the `128` url? – Book Of Zeus Jan 30 '12 at 00:45
  • Have you tried googling it? Do you have a a piece of code already tried? – Mike Jan 30 '12 at 00:45
  • 1
    Thanks guy, I did Google it and have come up with `Redirect /128 http://www.mysite.com/this-is-the-new-location/321` which is a simple redirect. I would prefer to cloak the URL and show the content of the new page on the old URL so as to not confuse the old users. – JoeW Jan 30 '12 at 00:47
  • googling it found also a tool to do it http://www.htaccessredirect.net/index.php :) – Mike Jan 30 '12 at 00:48

1 Answers1

0

This would be it

//301 Redirect Old File
Redirect 301 www.mysite.com/128 www.mysite.com/this-is-the-new-location/321

//301 Redirect Entire Directory
RedirectMatch 301 www.mysite.com/128(.*) www.mysite.com/this-is-the-new-location/321/$1
Mike
  • 3,017
  • 1
  • 34
  • 47