Welcome to WebmasterWorld Guest from 18.104.22.168 , register , login , search , subscribe , help , library , PubCon , announcements , recent posts , open posts Subscribe to WebmasterWorld
problem with virtual hosting .htacess being ignored neiljones msg:1522355 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
NameVirtualHost 22.214.171.124 <VirtualHost 126.96.36.199 > ServerAdmin email@example.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 188.8.131.52 > ServerAdmin firstname.lastname@example.org 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 msg:1522356 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 msg:1522357 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 184.108.40.206. 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 [
...] and [ httpd.apache.org ...] for more info. httpd.apache.org
jd01 msg:1522358 7:53 am on May 16, 2005 (gmt 0)
Can't see if this one got fixed either, but I can Bump!
neiljones msg:1522359 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.