Welcome to WebmasterWorld Guest from 54.147.44.93

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

problem with virtual hosting

.htacess being ignored

     

neiljones

4:31 pm on May 13, 2005 (gmt 0)

10+ Year Member



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

7:49 pm on May 13, 2005 (gmt 0)

10+ Year Member



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

8:11 pm on May 13, 2005 (gmt 0)

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



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

7:53 am on May 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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

Justin

neiljones

9:09 am on May 16, 2005 (gmt 0)

10+ Year Member



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

It is only now that I can answer.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month