homepage Welcome to WebmasterWorld Guest from 54.161.220.160
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
how to redirect entire site?
using htaccess
Craig_F

10+ Year Member



 
Msg#: 283 posted 4:44 pm on Jul 5, 2003 (gmt 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!

 

bcc1234

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 283 posted 5:05 pm on Jul 5, 2003 (gmt 0)

Yep, that's the correct way.

wilderness

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



 
Msg#: 283 posted 7:44 pm on Jul 5, 2003 (gmt 0)

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

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 283 posted 11:19 pm on Jul 5, 2003 (gmt 0)

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

SN

Craig_F

10+ Year Member



 
Msg#: 283 posted 10:50 pm on Jul 7, 2003 (gmt 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.

jdMorgan

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



 
Msg#: 283 posted 10:56 pm on Jul 7, 2003 (gmt 0)

Craig_F,

Use RedirectMatch [httpd.apache.org] instead:

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

Jim

Craig_F

10+ Year Member



 
Msg#: 283 posted 11:08 pm on Jul 7, 2003 (gmt 0)

Perfect. Thanks Jim!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved