The MU forums have moved to WordPress.org

please help me with my serveralias (7 posts)

  1. designoahu
    Member
    Posted 17 years ago #

    I am having trouble with new users on subdomains. I have setup a DNS entry:

    *.mydomain.com. 14400 IN A 12.34.56.78

    I also edited my httpd.conf with the folowing:

    <VirtualHost 12.34.56.78>
    ServerAlias *.mydomain.com
    ServerAdmin webmaster@mydomain.com.com
    DocumentRoot /home/username/public_html
    BytesLog domlogs/mydomain.com-bytes_log
    ServerName http://www.mydomain.com
    User username
    Group username
    CustomLog /usr/local/apache/domlogs/mydomain.com combined
    Options -ExecCGI -Includes
    <Directory "/home/username/public_html">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride FileInfo Options
    Order allow,deny
    allow from all
    </Directory>
    </VirtualHost>

    I am not sure if this is correct or not. BTW, I did restart BIND & APACHE. My problem seems to be that when I use a ServerAlias of *.mydomain.com only the subdomain will work but not the main site URL. If I use a ServerAlias of mydomain.com the subdomains do not work. I also tried adding:

    RedirectMatch 301 (.*) http://mydomain.com$1

    I got a neverending redirect because of this. Any help would be greatly appreciated.

    Thank You,
    Jeremy

  2. lunabyte
    Member
    Posted 17 years ago #

    ServerAlias mydomain.com *.mydomain.com

  3. gumdrop
    Member
    Posted 17 years ago #

    Shouldn't it be:

    ServerName mydomain.com
    ServerAlias *.mydomain.com

    seems the .htaccess file wants to:
    # Rewrite http://www.domain.com to domain.com
    RewriteCond %{HTTP_HOST} ^www\.(.*)

  4. lunabyte
    Member
    Posted 17 years ago #

    It should be there, probably.
    At least that's the "recommended" setup from the instructions.

    Technically, since www is a subdomain, it should answer for it because of the wildcard. Haven't played with it though.

    If it's not broken, I usually don't mess with it.

  5. gumdrop
    Member
    Posted 17 years ago #

    Well it worked for me...
    RedirectMatch 301 (.*) http://mydomain.com$1

    will cause loop

  6. lunabyte
    Member
    Posted 17 years ago #

    That would be bad, mkay. lol

  7. designoahu
    Member
    Posted 17 years ago #

    Thank you so much lunabyte. I was only able to get the main site or the subdomains to work; go figure I needed to add both to the alias.

    Cheers!

About this Topic

  • Started 17 years ago by designoahu
  • Latest reply from designoahu