+ Reply to Thread
Results 1 to 5 of 5

 

Thread: multiple domain names to one domain - need .htacess code

  1. #1
    Affiliate

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Bristol
    Posts
    2,200
    Thanks
    52
    Thanked 36 Times in 27 Posts


    Hi

    I want to redirect 3 domains to point at one

    i.e I have
    www.widgets.com
    www.widget.co.uk
    www.widget.com

    I want to redirect all of them to www.widgets.co.uk

    I have redirected directories but not whole sites before with .htacess.

    Can someone suggest the code I need I guess it will be a 301 redirect.

  2. #2
    Art
    Affiliate / Merchant

    Status
    Offline
    Join Date
    Jul 2005
    Location
    Costa Del Sol
    Posts
    480
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can put an index.php file in your public directory:
    PHP Code:
    <?
    Header
    "HTTP/1.1 301 Moved Permanently" );
    Header"Location: http://www.newsite.com" );
    ?>

    Is this OK for you?

  3. #3
    Typing with both fingers.

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Allt Y Coed Farm, North Pembrokeshire
    Posts
    4,122
    Thanks
    246
    Thanked 197 Times in 156 Posts
    I always use the following if I can't setup the redirection on my dns

    PHP Code:
    $handledir $_SERVER['HTTP_HOST'];
    if ((
    $handledir == "www.mysite.co.uk") OR ($handledir == "www.mysites.co.uk") OR ($handledir == "www.mysites.com")) {
    header("HTTP/1.1 301 Moved Permanently");
    header("Location: http://www.mysite.com");
    exit();

    I don't know anything about .htaccess I'm afraid


    Ta

  4. #4
    mxp
    Registered User

    Status
    Offline
    Join Date
    Dec 2004
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ive got to admit that .htaccess isnt my strong point but i think the following will achieve what you want.

    PHP Code:
    RewriteCond %{HTTP_HOST} !^www.widgets.co.uk
    RewriteRule 
    ^(.*)$ http://www\.widgets\.co\.uk/$1 [R=301,L] 
    (thinking about it the above will probably only work if all the domains are set to the same webspace)

    cheers
    mxp
    Last edited by mxp; 07-09-05 at 03:01 PM.

  5. #5
    Art
    Affiliate / Merchant

    Status
    Offline
    Join Date
    Jul 2005
    Location
    Costa Del Sol
    Posts
    480
    Thanks
    0
    Thanked 0 Times in 0 Posts

+ Reply to Thread


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Domain Names that had owners before you!
    By Supercod in forum Web Hosting & Security
    Replies: 9
    Last Post: 14-12-05, 11:34 AM
  2. New .eu domain names - £100+ each?
    By Azam.net in forum Affiliate Marketing Lounge
    Replies: 3
    Last Post: 29-06-05, 05:15 AM
  3. Domain Names For Sale
    By jamcamuk in forum Web Hosting & Security
    Replies: 0
    Last Post: 20-09-04, 09:19 PM
  4. Publisher Code of Conduct - Revised and Restated
    By Chris Clarkson in forum Commission Junction
    Replies: 2
    Last Post: 14-08-04, 09:33 PM
  5. host for multiple domain names - any recommendations?
    By emma in forum Web Hosting & Security
    Replies: 18
    Last Post: 26-11-03, 05:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2