SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    400 error hostname invalid

    Hi

    We moved a website to another dedicated host and found that the http://examplesite.com URL gives us a 400 error but the putting www in front makes it work

    so I placed the following code in the .HTAccess file and this has no effect


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

    is something messed up with the DNS?

    any ideas




    Many thanks

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

    Yes, it's your DNS. Check the A record as it needs to have both the www and non-www versions there TO RECEIVE THE REQUESTS. .htaccess if of no use if it doesn't receive the request, is it?

    If this is your localhost (test server), then you have the VirtualHost setup for only one version and, probably, nothing in your hosts file. Do go update both of those.

    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

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for your great knowledge, worked a treat. Perfect!


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
  •