Link to home
Start Free TrialLog in
Avatar of casper114
casper114Flag for United States of America

asked on

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
Avatar of IKZ
IKZ
Flag of United States of America image

Just add these two lines to your .htaccess file

RewriteEngine On RewriteRule ^/(.*)
http://www.example.com/$1 [L,R=301]
Avatar of Jones911
Jones911

is the ipaddress in DNS set correctly for the base record?  OR did u just set the www a record?
Avatar of casper114

ASKER

I set the www a record

i do not see a .htaccess file...
well its a DNS issue its probably still propagating or u forgot to set the base @ record.
The base A record look fine... any suggestions? Anything i can provide that will make it easier?
Did you set a host header entry for domain.com not just www.domain.com
 
 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
On the webserver did you set up a host header (IIS ) or a server alias ( Apache )
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
Post a screen shot.
 Here you go.

       Thanks!

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

untitled.bmp
ASKER CERTIFIED SOLUTION
Avatar of Jones911
Jones911

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Your host header is pointed to www.sitename remove the host header leave as default, or just use domainname.com and it should work.
Thank you!
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.
Gotchya! Thanks again!
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.
PPS
Other sites will require host header...