homepage Welcome to WebmasterWorld Guest from 54.234.141.47
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
problem with virtual hosting
.htacess being ignored
neiljones

10+ Year Member



 
Msg#: 3558 posted 4:31 pm on May 13, 2005 (gmt 0)

I have a server hosting a number of domains. Two of them require me to use url rewriting in a .htaccess file. Domain1 is working fine. To set up and check domain 2 I have copied some of domain1's files so I can be sure everything is identical.

However on domain2 the .htacess file seems to be beeing ignored.

Here is a sanitised chunk of the httpd.conf file

VirtualDocumentRoot /web/pathway/%0

NameVirtualHost 123.23.123.123

<VirtualHost 123.23.123.123 >
ServerAdmin postmaster@domain1.com
DocumentRoot /web/pathway/www.domain1.com/
ServerName domain1.com
ErrorLog /var/log/domain1.com-error_log
CustomLog /var/log/domain1.com-access_log common
ErrorDocument 404 /404/index.html
<Directory "/web/pathway/www.domain1.com">

Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
</Directory>
Options Indexes FollowSymLinks ExecCGI Includes
</VirtualHost>

<VirtualHost 123.23.123.123 >
ServerAdmin postmaster@domain2.com
DocumentRoot /web/pathway/www.domain2.com/
ServerName domain2.com
ErrorLog /var/log/domain2.com-error_log
CustomLog /var/log/domain2.com-access_log common
ErrorDocument 404 /404/index.html
<Directory "/web/pathway/www.domain2.com">

Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
</Directory>
Options Indexes FollowSymLinks ExecCGI Includes
</VirtualHost>

The VirtualDocumentRoot supports the domains that do not need url forwarding.

Interestingly when I comment it out Domain2 shows Domain1's content.

Can anyone tell me what is wrong?

 

neiljones

10+ Year Member



 
Msg#: 3558 posted 7:49 pm on May 13, 2005 (gmt 0)

When I talk about commenting out above #I am refereing to commenting out the VirtualDocumentRoot line.

I have however tried a further modification.

I commented out the Virtual host stuff for domain1.
This resulted in the .htaccess file working for Domain2!

I am still baffled.

jdMorgan

WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3558 posted 8:11 pm on May 13, 2005 (gmt 0)

This is not my strong suit, but it appears to me that you have two virtual hosts, both named 123.23.123.123. While this is permissible, you'll need to add ServerAliases if you want things to work correctly for 'www' subdomains of each domain. As it stands now, www.domain1.com and www.domain2.com either won't resolve, or will both resolve to the domain1.com virtualhost.

Hopefully, an expert will check in on this thread. In the meantime, see [httpd.apache.org...] and [httpd.apache.org...] for more info.

Jim

jd01

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 3558 posted 7:53 am on May 16, 2005 (gmt 0)

Can't see if this one got fixed either, but I can Bump!

Justin

neiljones

10+ Year Member



 
Msg#: 3558 posted 9:09 am on May 16, 2005 (gmt 0)

jdMorgan's response fixed the problem.
Thanks very much for your help.

It is only now that I can answer.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved