#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Posts
    31
    Rep Power
    9

    401 on no-www domain only


    I manage a tech support site, which has a mirrored private site for testing & development on the same server, and is protected by .htaccess

    A few days ago I added following to .htaccess at the root level, to redirect everything on the domain from http:// to http://www

    Code:
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^sitename\.com$ [NC]
    RewriteRule ^(.*)$ http://www.sitename.com/$1 [R=301,L]
    That worked perfectly for the public site; typing http://sitename.com will bring me to http://www.sitename.com. But when I type the http:// URL for the testbed, it throws this at me:

    Code:
    /401.shtml File not found, sorry. 404
    If I type http://www, then it works fine. But that's not desirable, as I expected it would behave the same as the public site, which redirects with no problem.

    Why does that happen for the testbed but not the public site, and how do I fix it?

    Thanks in advance for any help.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Posts
    31
    Rep Power
    9
    Please? I really need help with this.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Posts
    31
    Rep Power
    9
    Hello??
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Posts
    31
    Rep Power
    9
    bump because I REALLY need an answer.
  8. #5
  9. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,638
    Rep Power
    4247
    What does the testbed URL look like? This is very important.

    Code:
    RewriteCond %{HTTP_HOST} ^sitename\.com$ [NC]
    RewriteRule ^(.*)$ http://www.sitename.com/$1 [R=301,L]
    Do you understand regular expressions or did you just copy this from somewhere? By the way, you really should have posted this in the apache forum, which is why you never got any help so far.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo