How do I setup Apache, editing the httpd.conf file I think, to properly alias www so my server directs the right way?
Asked
Active
Viewed 603 times
0
-
Sorry, this question is really hard to understand. What exactly do you want to do? – Jul 14 '10 at 05:48
-
It's a searching bonanza! http://stackoverflow.com/questions/234723/generic-htaccess-redirect-www-to-non-www http://stackoverflow.com/questions/1478173/htaccess-redirect-www-to-non-www-with-ssl-https http://stackoverflow.com/questions/1973297/htaccess-for-www-only-redirection http://stackoverflow.com/questions/1685962/htaccess-redirect-non-www-to-www-preserving-uri-string http://stackoverflow.com/questions/2943761/htaccess-redirect-non-www-to-www-except-for-a-particular-subdirectory http://stackoverflow.com/questions/2388976/htaccess-and-no-www – Borealid Jul 14 '10 at 05:48
-
@Borealid, thanks for the links but they all seem to use .htaccess files... Should I not use httpd.conf file to do this? And I am not sure what I am 'looking for' I just want if someone types in my domain, with or without www for it to go to where it should... All my code is in the non-www location. And media temple told me I had to edit the httpd.conf file. – thatryan Jul 14 '10 at 17:50
-
@thatryan: An htaccess file is just another location for Apache configuration information. You can do the same things in a `
` block in httpd.conf. – Borealid Jul 14 '10 at 20:59 -
@Borealid Aha thanks for clearing that up, I thought they were two separate things ;) I enabled mod_rewrite on my server, now just not sure where exactly the file goes... – thatryan Jul 15 '10 at 05:04
-
This may help, I followed the instruction to install LAMP onto Ubuntu and when done I had a file structure like this image, http://img.skitch.com/20100715-jujg88f4xhb48p7t338bb3gpwi.png So where would I put an .htaccess file? And do I need to keep the structure like that? How it is now, it redirects typing 'domain.com' shows the root index list, and 'www.domain.com' redirects to 'domain.com/domain.com/html' Does that make sense? – thatryan Jul 15 '10 at 05:46
1 Answers
0
Are you looking for ServerName example.com
and ServerAlias www.example.com
? Note that those two names are different insofar as SSL certificates are concerned.

Borealid
- 95,191
- 9
- 106
- 122