[NTLUG:Discuss] add a subdomain from web page

Paul Ingendorf pauldy at wantek.net
Tue Nov 26 09:32:02 CST 2002


The following I think is what you are looking for.

<VirtualHost *:80>
        ServerAlias anotherdomain.on.maindomain.com
        ServerName SUBMAIN.on.maindomain.com
        ServerAdmin webmaster at test.com
        RewriteEngine on
        RewriteLog /var/log/httpd/rewrite_log.redirect
        RewriteLogLevel 1
        RewriteCond %{SERVER_NAME}      !^test123.test.com$
        RewriteRule ^/(.*)              http://test123.test.com/$1 [L,R]
</VirtualHost>

Quoting m m <llliiilll at hotmail.com>:

> 
> 
> Hi All:
> I want to add a subdomain from a web page to apache server, and the
> after create the subdomain, it will redirect to another site. for
> example:
> add SUBDOMAIN on maindomain.com, redirect to test123.test.com, when I
> type http://SUBMAIN.on maindomain.com, it bring me to
> http://test123.test.com.
> I am thinking that I have to do those steps:
> 
> 1. Wildcard DNS entry for this domain in the DNS server.
> 
> change:
> www IN A 123.123.123.123
> 
> to or replace with:
> * IN A 123.123.123.123
> 
> 2. open http.conf file add
> 
> <VirtualHost *:80>
>    UseCanonicalName off
>    VirtualDocumentRoot /www/%0
>    VirtualScriptAlias /www/%0/cgi-bin
> </VirtualHost>
> 
> 3. create a web page, have 2 text fields asking for subdomain name and
> redirect url.
> 
> 4 create a subdirectory under /www/ with the subdomain name and create
> a .access file with redirect url in it.
> 
> are these steps right?
> step 1.2 is an one-time deal, step 3. can use html page to achieve it.
> how do I do on step 4? use perl and cgi to make it?
> 
> any one have better idea or give some example to achieve it?
> 
> Thanks in advance.
> 
> 
> 
> 
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*. 
> http://join.msn.com/?page=features/featuredemail
> 
> 
> _______________________________________________
> https://ntlug.org/mailman/listinfo/discuss
> 



-- 
-->> mailto:pauldy at wantek.net
-->> http://www.wantek.net/
Running ....... Cos anything else would be a waste...
`:::\'                  .......  ......
 :::  *                  `::.    ::\'
 ::: .::  .:.::.  .:: .::  `::. :\'
 :::  ::   ::  ::  ::  ::    :::.
 ::: .::. .::  ::.  `::::. .:\'  ::.
:::.....................::\'   .::::..




More information about the Discuss mailing list