SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2004
    Location
    Watford, UK
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ampersand in domain

    Hi,

    A client of mine has done a big leaflet drop and entered their domain with an ampersand as opposed to the word 'and'.

    Is there anything I can do with htaccess/dns/whatever to redirect the incorrect url's to the correct url? I am aware ampersands cannot be used in domain names, however the client wasn't.

    Thanks
    Andy

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    Hailsham, UK
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Andy,

    If it's www.something&something.com there's not a lot technically you can do -- the DNS request won't get anywhere near to what you can control (ie, the real domain's DNS entries).

    If the & sign was in the host part (www) then you might have a fighting chance of using a * A record or something. If the & is in the path part of the URL then it should be do-able with htaccess.

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2004
    Location
    Watford, UK
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, thank you. No i'm afraid it's in the www.something&something.com part. From my knowledge I didn't think anything could be done, but i've never come across this problem so thought i'd ask. Thanks for your reply.

    Andy

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,604
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    ar,

    Quote Originally Posted by http://www.ietf.org/rfc/rfc2396.txt
    The host is a domain name of a network host, or its IPv4 address as a
    set of four decimal digit groups separated by ".". Literal IPv6
    addresses are not supported.

    hostport = host [ ":" port ]
    host = hostname | IPv4address
    hostname = *( domainlabel "." ) toplabel [ "." ]
    domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
    toplabel = alpha | alpha *( alphanum | "-" ) alphanum
    That's "geek-speak" for you can't do that as "&" is an illegal character.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  5. #5
    Twitter: @SprightlyMedia Manpasand's Avatar
    Join Date
    Feb 2005
    Location
    Internet
    Posts
    405
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think it is technically incorrect since & treated as  

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,603
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Manpasand View Post
    I don't think it is technically incorrect since & treated as  
    not by domain name servers.

    Invalid characters such as & in the actual domain name are going to get rejected by the first domain name server that sees them and never get close to any web hosting.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  7. #7
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,604
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    ^ what felgall says!

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  8. #8
    SitePoint Wizard SiberForum's Avatar
    Join Date
    Dec 2007
    Posts
    1,197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I suppose you can use that in the site title &&& but in the domain name you must use "and"
    The brigjt example is 1&1

  9. #9
    Twitter: @SprightlyMedia Manpasand's Avatar
    Join Date
    Feb 2005
    Location
    Internet
    Posts
    405
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    Invalid characters such as & in the actual domain name are going to get rejected by the first domain name server that sees them and never get close to any web hosting.
    Yes, I agree.

  10. #10
    SitePoint Wizard silver trophy linkin99's Avatar
    Join Date
    Sep 2005
    Location
    Wisconsin
    Posts
    1,456
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, it is an invalid character. Your only real hope is that people understand that it's a mistake and try typing out the "and" instead of the "&".


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
  •