Remove www requirement from website

Good afternoon everyone,

      Currently i am redirecting one of my websites to our current main website. For some reason when i leave off the www. it prompts public users for a username and password. I need to change it to redirect to the website weather someone uses the www.website or website format in the URL. Let me know if you need any more information.

       Thank you,

 -Casper114
casper114Asked:
Who is Participating?
 
Jones911Connect With a Mentor Commented:
Remove the IP leave it as default.
0
 
IKZCommented:
Just add these two lines to your .htaccess file

RewriteEngine On RewriteRule ^/(.*)
http://www.example.com/$1 [L,R=301]
0
 
Jones911Commented:
is the ipaddress in DNS set correctly for the base record?  OR did u just set the www a record?
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
casper114Author Commented:
I set the www a record

i do not see a .htaccess file...
0
 
Jones911Commented:
well its a DNS issue its probably still propagating or u forgot to set the base @ record.
0
 
casper114Author Commented:
The base A record look fine... any suggestions? Anything i can provide that will make it easier?
0
 
Jones911Commented:
Did you set a host header entry for domain.com not just www.domain.com
0
 
casper114Author Commented:
 
 This is what my DNS records look like. Can you tell with this information?

DNS records for mydomain.com.:

 Name           Type        Data  
                     SOA        cbru.br.ns.els-gms.att.net.    
                     NS           cbru.br.ns.els-gms.att.net.
                     NS           cmtu.mt.ns.els-gms.att.net.
@.                 A             12.49.x.x    
localhost.      A             127.0.0.1    
mail.              A              12.49.x.x    
test.              A              12.49.x.x  
www.          A              12.49.x.x    
@.                MX             10 mail.mydomain.com.    
 

      Thanks!

 -Casper
0
 
Jones911Commented:
On the webserver did you set up a host header (IIS ) or a server alias ( Apache )
0
 
casper114Author Commented:
Yes I have a host header set with the internal IP address of the webserver and the www.mydomain.com value and I have an ip address showing default with a host header value of mydomain.com without the www.

      Thanks!

 -Casper
0
 
Jones911Commented:
Post a screen shot.
0
 
casper114Author Commented:
 Here you go.

       Thanks!

 -Casper
0
 
Jones911Commented:
That didnt work :)
0
 
casper114Author Commented:
whoops. sorry about that. here you go.
     Thanks!
-Casper
 
 

untitled.bmp
0
 
BMPTSCommented:
Your host header is pointed to www.sitename remove the host header leave as default, or just use domainname.com and it should work.
0
 
casper114Author Commented:
Thank you!
0
 
Jones911Commented:
Don't remove the host header's leave it as it is this way you can add more sites later without any changes.  Glad you now have it working.
0
 
casper114Author Commented:
Gotchya! Thanks again!
0
 
BMPTSCommented:
as an FYI you can add additional sites even with a default host header set to nothing... as long as it's in IIS should be fine... don't know anything about apache.
0
 
BMPTSCommented:
PPS
Other sites will require host header...
 
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.