Need Help with Error 404, Special Case...
<VirtualHost 0.0.0.0>
ServerAlias www.mydomain.com mydomain.com
ServerAdmin webmaster@mydomain.com
DocumentRoot /home/mydom/public_html
BytesLog domlogs/mydomain.com-bytes_log
ServerName www.mydomain.com
User mydom
Group mydom
CustomLog domlogs/mydomain.com combined
ScriptAlias /cgi-bin/ /home/mydom/public_html/cgi-bin/
</VirtualHost>
<VirtualHost 0.0.0.0>
UseCanonicalName Off
ServerAlias *.mydomain.com
ServerAdmin webmaster@mydomain.com
VirtualDocumentRoot /home/mydom/public_html/%1
BytesLog domlogs/mydomain.com-bytes_log
User mydom
Group mydom
CustomLog domlogs/mydomain.com combined
ScriptAlias /cgi-bin/ /home/mydom/public_html/cgi-bin/
</VirtualHost>
This is my two entries into httpd.conf. I have it setup, so if it's www.mydomain.com or mydomain.com ,it goes to the main site automatically, and then i have it setup so if it's ANY subdomain at all, it will resolve to /subdomain/ on the server.
MOST are 404's right now unless the folder exists, then it works perfectly.
I tried putting in a ErrorDocument 404 /index.php (since that is what I need it to do, but it didn't work.) I had to use ErrorDocument 404 http://www.mydomain.com/index.php which is NOT what I want, it does not work with my ******** like service, I need it to show the main page but the URL in the title bar CANNOT change.
Any ideas?
IS it possible to have a IF statement, so I can write a IF statment in the httpd.conf, and IF it's a 404, then it SETS the VirtualDocumentRoot = /home/mydomain/public_html/ and IF it's NOT 404, it sets VirtualDocumentRoot = /home/mydomain/public_html/%1
Thanks in advance, I hope I can get some help.