Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004
    Location
    Behind You.
    Posts
    692

    Need Help with Error 404, Special Case...



    <VirtualHost 0.0.0.0>
    ServerAlias www.mydomain.com mydomain.com
    ServerAdmin [email protected]
    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 [email protected]
    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.

  2. #2
    Join Date
    Jul 2004
    Posts
    44
    have you tried ErrorDocument 404 /home/mydom/public_html/index.php ?
    busybits web directory <-- submit your site and increase your exposure

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •