Welcome to WebmasterWorld Guest from 54.227.125.200

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

how to redirect entire site?

using htaccess

     

Craig_F

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

10+ Year Member



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!

bcc1234

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

WebmasterWorld Senior Member 10+ Year Member



Yep, that's the correct way.

wilderness

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

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



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?

killroy

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

WebmasterWorld Senior Member 10+ Year Member



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

SN

Craig_F

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

10+ Year Member



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.

jdMorgan

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

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



Craig_F,

Use RedirectMatch [httpd.apache.org] instead:


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

Jim

Craig_F

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

10+ Year Member



Perfect. Thanks Jim!
 

Featured Threads

Hot Threads This Week

Hot Threads This Month