On 2007-01-03 07:21:50 -0700, Tim Riley <[email protected]> said:

> 
> 
> I'm writing a web application in web.py and I am looking for an example 
> configuration that would allow me to redirect sub domains to a specific 
> url in my application. For example I need tim.mydomain.com to redirect 
> to the url "/profile/tim", john.mydomain.com to redirect to the url 
> "/profile/john", etc. I looked at the documentation and the virtual 
> host thing seems nice but I need to be able to have users generate 
> these sub domains on the fly.
> 
> I was looking at redirection and it seems like it may be what I'm 
> looking for but I can't seem to figure out how to achieve this. If 
> anyone can give me a pointer it would be greatly appreciated.

Currently there is no really dead simple way of creating virtual hosts. 
 You could have a script write to the cherokee config file, but that 
will require restarting the web server for the changes to take affect.  
Or at least I am not aware that cherokee can do configuration refreshes 
while running.  I have been looking into writing code to perform MySQL 
virtual hosts, but been quite busy with other things.

One thing to keep in mind is that cherokee won't be able to do all of 
what you requesting.  It will be able to handle it, but to create 
dynamic sub domains you will also need to get a form of dynamic DNS to 
handle the actual pointing of the sub domain.  I am sure there are 
MySQL based DNS servers you can search for.  I just don't know what 
level of control you have over your server.

> 
> 
> 
> 
> -------
> 
> Read this topic online here:
> http://www.cherokee-project.com/forum/viewtopic.php?p=193#193
> 
> -------
> 
> 
> 
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <style type=3D"text/css">
> <!--
> 
> /*
>   The original subSilver Theme for phpBB version 2+
>   Created by subBlue design
>   http://www.subBlue.com
> 
>   NOTE: These CSS definitions are stored within the main page body so that =
> you can use the phpBB2
>   theme administration centre. When you have finalised your style you could=
>  cut the final CSS code
>   and place it in an external file, deleting this section to save bandwidth=
> .
> */
> 
> 
>  /* General page style. The scroll bar colours only visible in IE5.5+ */
> body {
>       background-color: #E5E5E5;
>       font-family: Verdana, Arial, Helvetica, sans-serif;
>       font-size: 11;
>       color: #000000;
> }
> 
> /* General font families for common tags */
> font,th,td,p { font-family: Verdana, Arial, Helvetica, sans-serif }
> p, td         { font-size : 11; color : #000000; }
> a:link,a:active,a:visited { color : #006699; }
> a:hover               { text-decoration: underline; color : #DD6900; }
> hr    { height: 0px; border: solid #D1D7DC 0px; border-top-width: 1px;}
> h1,h2         { font-family: "Trebuchet MS", Verdana, Arial, Helvetica, 
> sans-serif=
> ; font-size : 22px; font-weight : bold; text-decoration : none; line-height=
>  : 120%; color : #000000;}
> 
> 
> /* This is the border line & background colour round the entire page */
> .bodyline     { background-color: #FFFFFF; border: 1px #98AAB1 solid; }
> 
> 
> /* General text */
> .gen { font-size : 12px; }
> .genmed { font-size : 11px; }
> .gensmall { font-size : 10px; line-height: 12px}
> .gen,.genmed,.gensmall { color : #000000; }
> a.gen,a.genmed,a.gensmall { color: #006699; text-decoration: none; }
> a.gen:hover,a.genmed:hover,a.gensmall:hover   { color: #DD6900; text-decorati=
> on: underline; }
> 
> 
> /* Forum title: Text and link to the forums used in: index.php */
> .forumlink            { font-weight: bold; font-size: 12px; color : #006699; }
> a.forumlink   { text-decoration: none; color : #006699; }
> a.forumlink:hover{ text-decoration: underline; color : #DD6900; }
> 
> 
> /* The content of the posts (body of text) */
> .postbody { font-size : 12px; line-height: 18px}
> a.postlink:link       { text-decoration: none; color : #006699 }
> a.postlink:visited { text-decoration: none; color : #5493B4; }
> a.postlink:hover { text-decoration: underline; color : #DD6900}
> 
> 
> /* Quote & Code blocks */
> .code {
>       font-family: Courier, 'Courier New', sans-serif; font-size: 11px; 
> color: #=
> 006600;
>       background-color: #FAFAFA; border: #D1D7DC; border-style: solid;
>       border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; 
> bo=
> rder-bottom-width: 1px
> }
> 
> .quote {
>       font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; 
> color=
> : #444444; line-height: 125%;
>       background-color: #FAFAFA; border: #D1D7DC; border-style: solid;
>       border-left-width: 1px; border-top-width: 1px; border-right-width: 1px; 
> bo=
> rder-bottom-width: 1px
> }
> 
> -->
> </style>
> </head>
>       <body>
> 
>       <div class=3D"postbody">I'm writing a web application in web.py and I 
> am l=
> ooking for an example configuration that would allow me to redirect sub dom=
> ains to a specific url in my application. For example I need tim.mydomain.c=
> om to redirect to the url "/profile/tim", john.mydomain.com to redirect to =
> the url "/profile/john", etc. I looked at the documentation and the virtual=
>  host thing seems nice but I need to be able to have users generate these s=
> ub domains on the fly.<br />
> <br />
> I was looking at redirection and it seems like it may be what I'm looking f=
> or but I can't seem to figure out how to achieve this. If anyone can give m=
> e a pointer it would be greatly appreciated.</div>
>       <br /><div class=3D"gensmall"><br />
> <br />
> <br />
> -------<br />
> <br />
> Read this topic online here:<br />
> <a href=3D"http://www.cherokee-project.com/forum/viewtopic.php?p=3D193#193"=
>  target=3D"_blank">http://www.cherokee-project.com/forum/viewtopic.php?p=3D=
> 193#193</a><br />
> <br />
> -------</div>
>       </body>
> </html>
> 
> 
> 
> 
> _______________________________________________
> Cherokee mailing list
> [email protected]
> http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee


-- 
Brian Rosner
http://www.brosner.com/blog


_______________________________________________
Cherokee mailing list
[email protected]
http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee

Reply via email to