Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

www.domain and subdomians

Status
Not open for further replies.

steam

ISP
Jul 17, 2000
51
IT
<br>How can I configure apache so that the url can be received with or without the www. in front<br><br>Also, how can I make this:<br>url=news.domain.com&nbsp;&nbsp;---&gt; contents in --&gt; domain.com/news<br><br>is this related to aliases? How?<br><br>thank you.
 
To configure apache to take news.domain.com from /domain/news, all you need to do is to set up a virtual server. <br><br>You need something like this in http.conf:<br>NameVirtualHost 192.168.1.1<br><br>&lt;VirtualHost 192.168.1.1&gt;<br>DocumentRoot /domain/ <A HREF=" TARGET="_new"> 192.168.1.1&gt;<br>DocumentRoot /domain/news<br>Servername news.domain.com<br>&gt;<br><br><br><br><br>
 
Yes, this is something I know.<br>My problem is a more complicated ... I guess!<br><br>I want to make sure that people asking for <br><br>whatever.domain.com automatically display the relative sub directory contents (domain/ This should be for ANY directory under domains. So that I don't have to create a virtualhost for each directory.<br><br>Concerning the front I suppose it could be solved with an alias.<br><br>ServerAlias domain.com <A HREF=" TARGET="_new">
 
Has this question been finally answered?

I have a related question, very similar, but in reverse.

My current domain is listed as which contains the &quot; prefix.

I have seen many, many web sites where I can type instead, without the &quot; prefix, and the browser displays the URL WITHOUT the &quot; prefix. It also displays it WITH, if I type it so.

One example of this is &quot; which displays their address both ways. Type it with the &quot; and it shows. Type it without the &quot; and it shows it without the &quot;
I think the answer lies in &quot;mod_rewrite&quot;.

Can somebody direct me please to the correct place to find out?

Thanks
Russell Collier
Russell Collier
russell@athyrium.ca
(web site definitely still under construction)
 
This can also be corrected at your domain manager, i.e., with the interface you use to manage your DNS with your registrar. You redirect *.domain.com to Newposter
&quot;Good judgment comes from experience. Experience comes from bad judgment.&quot;
 
Great tips, guys. Thanks a lot! I'll pass these along to my host and see what they make of it.

I'll also try it out on my home PC (Linux box with Apache) and see if I can make it go myself.

Regards,
Russell Russell Collier
russell@athyrium.ca
(web site definitely still under construction)
 
Like newposter said, you won't be able to access the site with &quot; until you set up the host name on your dns server or add it to your hosts file (which works for testing, but not for production).

Once that is handled, then you should generally be able to connect to the web server with any host name, unless you set up virtual hosts.

Without virtual hosts, it will post the document root to anyone who connects to that system on port 80. With virtual hosts, the page that displays depends on either which ip address you connect to (e.g., intranet vs extranet) or what the fqdn is (e.g., vs funkychicken.example.com).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top