Results 1 to 11 of 11

htaccess redirect all .co.uk to .com?

This is a discussion on htaccess redirect all .co.uk to .com? within the Off-Topic & Chit Chat forums, part of the Focus on Members category; help! trying to redirect all .co.uk to .com! regards...

  1. #1
    Senior Member
    Real Name
    Martyn Day
    Join Date
    Dec 2005
    Location
    Kent - UK
    Posts
    650
    Liked
    0 times
    Blog Entries
    1

    htaccess redirect all .co.uk to .com?

    help!

    trying to redirect all .co.uk to .com!

    regards

  2. #2
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2

  3. #3
    Senior Member
    Real Name
    Martyn Day
    Join Date
    Dec 2005
    Location
    Kent - UK
    Posts
    650
    Liked
    0 times
    Blog Entries
    1
    doesnt really state for .co.uk to .com just either www or non www.. but anyway i tried and i get

    Code:
    The page isn't redirecting properly
    
          
    
          
          
          
    
          
            
            
    
              
    
    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
    
            
    
    
            
            
    
    
        *   This problem can sometimes be caused by disabling or refusing to accept
              cookies.

  4. #4
    Senior Member
    Real Name
    Martyn Day
    Join Date
    Dec 2005
    Location
    Kent - UK
    Posts
    650
    Liked
    0 times
    Blog Entries
    1
    this isnt for a vbulletin forum, thats why i posted it in offtopic. its for a mate....

    currently using
    Code:
    RewriteCond %{HTTP_HOST} !^www\.kite-riders\.co.uk
    RewriteRule (.*) http://www.kite-riders.com/$1 [R=301,L]

  5. #5
    Senior Member
    Real Name
    Ceri May
    Join Date
    Jul 2009
    Location
    United Kingdom
    Posts
    1,726
    Liked
    15 times
    Blog Entries
    1
    The code you have reads...

    if it is not www.kite-riders.co.uk redirect to カイトライダー.com サーフィン カイト ボーディング 相互 リンク マリン サイト which will continue to redirect because it will never be right..

    you should use

    Code:
    RewriteCond %{HTTP_HOST} !^www\.kite-riders\.com
    RewriteRule (.*) http://www.kite-riders.com/$1 [R=301,L]
    which says if it is anything bug kite-riders.com (including kite-riders.co.uk) then redirect.

    Ceri

  6. #6
    Senior Member woostar's Avatar
    Real Name
    woostar
    Join Date
    Apr 2007
    Posts
    788
    Liked
    5 times
    Quote Originally Posted by Martyn View Post
    this isnt for a vbulletin forum, thats why i posted it in offtopic. its for a mate....

    currently using
    Code:
    RewriteCond %{HTTP_HOST} !^www\.kite-riders\.co.uk
    RewriteRule (.*) http://www.kite-riders.com/$1 [R=301,L]
    I redirect the .co.uk version of my forum to the .com using this:
    RewriteCond %{HTTP_HOST} ^(www.)?domain.co.uk$
    RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
    2011 Average: 1 post every 5 seconds... 24/7

  7. #7
    Senior Member
    Real Name
    Martyn Day
    Join Date
    Dec 2005
    Location
    Kent - UK
    Posts
    650
    Liked
    0 times
    Blog Entries
    1
    both of them work for the non-www but if its www and .co.uk it doesnt turn it into .com!!?

    any suggestions welcomed

    Regards

  8. #8
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    .if .co.uk is parked on .com,

    "if its not domain.com, make it domain.com"

    RewriteCond %{HTTP_HOST} !^domain\.com$
    RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]


    you can www to the rules if desired.

  9. #9
    Senior Member
    Real Name
    Martyn Day
    Join Date
    Dec 2005
    Location
    Kent - UK
    Posts
    650
    Liked
    0 times
    Blog Entries
    1
    how would i www. it? just add ^(www.)?domain.co.uk$?

  10. #10
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    RewriteCond %{HTTP_HOST} !^www\.domain\.com$
    RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]

    "if not www dot domain dot com, make it www dot domain dot com"

  11. #11
    Senior Member
    Real Name
    Martyn Day
    Join Date
    Dec 2005
    Location
    Kent - UK
    Posts
    650
    Liked
    0 times
    Blog Entries
    1
    working so far. thanks Brian

Similar Threads

  1. htaccess no redirect 301
    By Nokturno in forum General Discussion
    Replies: 1
    Last Post: 07-05-2010, 12:05 AM
  2. asking about htaccess Redirect
    By dinhchi.com in forum Off-Topic & Chit Chat
    Replies: 3
    Last Post: 01-22-2008, 11:20 PM
  3. .htaccess redirect
    By reefland in forum General Discussion
    Replies: 2
    Last Post: 01-05-2007, 06:12 PM
  4. Redirect via .htaccess
    By reefland in forum General Discussion
    Replies: 2
    Last Post: 11-01-2006, 03:48 AM

Posting Permissions

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