fredf Posted November 29, 2006 Share Posted November 29, 2006 How can I configure apache to route "www.domainname.com" AND "domainname.com" to a website?? I'm pretty new to PHP.. thanks! Quote Link to comment https://forums.phpfreaks.com/topic/28902-routing-domain-name/ Share on other sites More sharing options...
steviewdr Posted November 30, 2006 Share Posted November 30, 2006 Do you have access to apache configs? Is this on windows or *nix? What version of apache?If you have access to the configs - the code here is what you need:[code] NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName www.domain.com ServerAlias domain.com DocumentRoot /home/domain/public_html/ HostnameLookups Double CustomLog /var/log/apache2/access.log combined ErrorLog /var/log/apache2/error.log Loglevel warn <Directory /> Options FollowSymLinks Indexes MultiViews AllowOverride None </Directory></VirtualHost>[/code]Try putting the above code in your apache.conf or http.conf depending on your apache setup.-steve Quote Link to comment https://forums.phpfreaks.com/topic/28902-routing-domain-name/#findComment-132694 Share on other sites More sharing options...
fredf Posted November 30, 2006 Author Share Posted November 30, 2006 Steve, thanks for the replyI'm working on a Mac using a webmin to edit the configs.. It's version 1.15 with Mandrake Linux 10.0..I do have access to the config though, and I put the code you posted into http.config.. dropped in my domain name and switched to DocumentRoot to match the one set at beginning of the my http.config.. the virtualhost came up, but it didn't work when I tested it, Is there anything else I need to replace in the code??There's some other setup options within the virtual to redirect URLs, I messed around a little with these settings but no luck...? Quote Link to comment https://forums.phpfreaks.com/topic/28902-routing-domain-name/#findComment-132999 Share on other sites More sharing options...
fredf Posted November 30, 2006 Author Share Posted November 30, 2006 Figured it out, thanks! Quote Link to comment https://forums.phpfreaks.com/topic/28902-routing-domain-name/#findComment-133047 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.