Forum Moderators: phranque

Message Too Old, No Replies

Redirect from old URL to new URL

Old URL still showing in browser

         

henry0

5:05 pm on Sep 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I took over a news site and related hard copy newspaper about one year ago

Made a brand new site (new URL)
The previous business webmaster had done a redirect that sends old URL users to the new URL

To my surprise when visited by users coming through the old URL I just figured that the browser was showing the old URL although it displays my new site

How may (if possible) I get the address to be shown as the new URL since it shows the new site?
it's important for the old URL account for about 30% of total visits.
I wish the new address to be used and will cancel the other one within a year ot two.

thanks
Regards

claus

5:16 pm on Sep 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could try including this little javascript on your page (edit "new-domain.com" to suit your needs first):

<script type="text/javascript"><!--
var U = 'http:\/\/www.new-domain.com\/'
if (window.location.href != U) window.location.href = U;
//--></script>

Just put it in the <head> section, it will do the job instantly.

In addition to this you should make the redirect a "301 redirect" using the ".htaccess" file. There's a lot of threads on this subject.

A 301 redirect will tell the visiting browser and the Search Engines that the old URL is no longer valid and the new one should be used in stead. Here's an example of what you could write in the .htaccess file of the old domain (it must be done on the old domain)

RewriteEngine on 
RewriteRule (.*) http://www.new-domain.com/ [R=301]

/claus

henry0

6:43 pm on Sep 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



claus
that shlould fine
thanks a lot

Henry