Welcome to WebmasterWorld Guest from 54.163.49.19

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

how to redirect entire site?

using htaccess

     
4:44 pm on Jul 5, 2003 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 2, 2001
posts:597
votes: 0


In the past I've done this for a few pages like this:

RedirectPermanent /page.htm [SameDomain.com...]

Now I need to redirect an entire site to the index page of the new site. Not sure how it's done I did this:

RedirectPermanent / [NewDomain.com...]

Anyone know if that's the correct way? I looked around a bit and couldn't find anything that directly stated it is or not.

Thanks!

5:05 pm on July 5, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:July 1, 2002
posts:1421
votes: 0


Yep, that's the correct way.
7:44 pm on July 5, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member wilderness is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 11, 2001
posts:5408
votes: 2


I recall reading previously a redirect which included matching sub-folders, sub-domains and files which were existent on the old domain being redirected to the new domanin.
EX:
olddomain.com/foo/foo.html
newdomain.com/foo/foo.html

Might this be accomplised with all files and subfolders with a solitary line of htaccess? or even a few lines rather than creating redirects for hunddreds and perhaps thousands of files and folders?

11:19 pm on July 5, 2003 (gmt 0)

Senior Member from MT 

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 1, 2003
posts:1843
votes: 0


sure, jsut don'T add a fielname in the target.

SN

10:50 pm on July 7, 2003 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 2, 2001
posts:597
votes: 0


something is not right with what I'm doing here (see post #1). with that in my htaccess any links that go to a specific page get a 404 from the site I'm redirecting to since with that statement the server still looks for the same file, but on the new domain.

Anyone know how to fix that? Ideally, I want any and all links to the old site to go to the home page of the new site. I've tried a bunch of variations of the above but nothing seems to work. Thanks.

10:56 pm on July 7, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


Craig_F,

Use RedirectMatch [httpd.apache.org] instead:


RedirectMatch 301 ^.*$ http://www.NewDomain.com/index.htm

Jim
11:08 pm on July 7, 2003 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 2, 2001
posts:597
votes: 0


Perfect. Thanks Jim!