> -----Original Message----- > From: kernel.2k5 [mailto:[EMAIL PROTECTED] > Sent: Wednesday, January 30, 2008 7:28 PM > To: users@httpd.apache.org > Subject: Re: [EMAIL PROTECTED] URGENT Attention Problem > > > HI All , Now I tried with this new Code . but nothings works as , Now > Its really needs to work as we all predict. > have a look > > ---------------------------------------------httpd.conf----------- > Listen 0.0.0.0:80 > > ServerName localhost:80 > > NameVirtualHost 127.0.0.1:80 > NameVirtualHost 210.18.170.226:80 > > <VirtualHost 127.0.0.1:80> > > DocumentRoot /var/www/html/site1 > ServerName site1.com > ServerAlias www.site1.com > > </VirtualHost> > > <VirtualHost 127.0.0.1:80> > > DocumentRoot /var/www/html/site2 > ServerName site2.com > ServerAlias www.site2.com > Alias /about /var/www/html/site2/about/index.html > Alias /feedback /var/www/html/site2/feedback.html
These Alias directives are completely pointless. You have defined the DocumentRoot as "/var/www/html/site2", so a request for http://site2.com/ will map to /var/www/html/site2 and http://site2.com/about will map to /var/www/html/site2/about and so on. So there is no need for all the Aliases. You just need to set: DirectoryIndex index.html feedback.html to get those files picked up by default (see http://httpd.apache.org/docs/2.2/mod/mod_dir.html#directoryindex for details) BTW, if you are trying to prevent that the user ever sees a ".html" file (ie, so that the browser always shows http://site2.com/about etc) then you are re-inventing the web and giving yourself a lot of work for a pointless cosmetic effect... > > </VirtualHost> > > <VirtualHost 210.18.170.226:80> > > DocumentRoot /var/www/html/site4 > ServerName livetekindia.com > ServerAlias www.livetekindia.com > Alias /about /var/www/html/site4/about/index.html > Alias /feedback /var/www/html/site4/feedback.html > Alias /useme /var/www/html/site4/index2.html > Alias /cp1 /var/www/html/site4/index3.html > Alias /foo /var/www/html/site4/foo.php > > </VirtualHost> > > ---------------------------------------httpd.conf Ends--------------- > > > Now when i try in FireFox > > http://site1.com ----------It works > > http://site2.com ----------It works > > http://site2.com/about ----------It wont redirect to page > /about/index.html means it wont works Please use accurate terminology. "Redirect" means the server sends a new URL back to the clinet and then the client makes a new request. You are not doing this, you are "aliasing", which means that the server goes to a different filesystem location to get the file, without telling the client about it. Do you get a 404? What *exactly* does it say in the error log? Is the file really there? You have made several typos in your posts and I suspect you could easily have a typing error in the path in your config file. Please check it carefully for spelling and case. > > It gives me a message like ------------- > > "The document you requested was not found. May we suggest our > home page > <http://site2.com/?dl=1>?" > same for /feedback too. > > Now then i tried > > http://livetekindia.com --------Nothings works and it opens > search.com . > http://livetekindia.com/about --------Nothings works. > http://livetekindia.com/foo --------Nothings works . This domain is not in DNS. This cannot work on the public internet. Have you registered this domain? > > but when i tried > > http://210.18.170.226 -------- it works and open the default > index page . > http://210.18.170.226/about -------- it works and open the default > index page . > http://210.18.170.226/feedback -------- it works and open the default > feedback.html page . > http://210.18.170.226/foo -------- it works and open the default > foo.php page . > http://210.18.170.226/useme and cp1 -------- it wont works and give > the error Object not found 404. What is exact message in error log? See notes above - cross-check paths in config with actual paths on file-system. Check spelling and case. Rgds, Owen Boyle Disclaimer: Any disclaimer attached to this message may be ignored. > > I am confused ,what apache want me to do .Or i am making any > mistakes Now . > > Plz help me . > > Thanks to all of you !!!! > > > > > Krist van Besien wrote: > > On Jan 30, 2008 1:24 PM, kernel.2k5 <[EMAIL PROTECTED]> wrote: > > > > > >> if i type in URL .... > >> > >> *http://192.168.10.2/fotostick/about * > >> > >> then it must open the Alias of its that is index.php page > but its not > >> working > >> > > > > You are not telling the server which of the two virtual > hosts you want > > the content to come from. In that case the server passes > your request > > to the first virtual host, which might not be what you want. > > > > Name based virtual hosts work only when you access a webserver using > > it's _name_. Try requesting > > http://www.livetekindia12.com/fotostick/about. Don.t use IP > adresses. > > > > Secondly, you have an alias "/about". this will not be used when you > > try accessing "/fotostick/about". Try accessing > > http://www.livetekindia12.com/about > > > > If you want "/fotostick/about" to be aliased somewhere you will need > > to add a line like this: > > Alias /fotostick/about /var/www/html/fotostick/index.php > > > > Krist > > > > > > -- > ======================================================= > With Best Regards > > Mr.Shailesh Bhutada > ======================================================= > > > --------------------------------------------------------------------- > The official User-To-User support forum of the Apache HTTP > Server Project. > See <URL:http://httpd.apache.org/userslist.html> for more info. > To unsubscribe, e-mail: [EMAIL PROTECTED] > " from the digest: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. If you receive this message in error, please notify the sender urgently and then immediately delete the message and any copies of it from your system. Please also immediately destroy any hardcopies of the message. The sender's company reserves the right to monitor all e-mail communications through their networks. --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: [EMAIL PROTECTED] " from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]