[Nitro] Apache question
chris
prpht9 at gmail.com
Tue Nov 6 09:26:25 EST 2007
RewriteCond %{HTTP_HOST} !^(.*).mysite.com [NC]
RewriteRule ^/(.*)$ http://www.mysite.com/view/%1/$1 [L,R]
To have http://www.mysite.com/ not be rewritten we may need to put in
another line to tell the RewriteCond to skip direct http calls to
www.mysite.com. Unfortunately I don't have anywhere to test this, so you'll
have to let me know how it goes and I can keep looking into the skip
directive.
-Chris
On Nov 6, 2007 1:54 AM, George Moschovitis <george.moschovitis at gmail.com>
wrote:
> I don't want a VirtualHost.
> I will have 100.000 different usernames. I can't add a VirtualHost for
> each one of them.
>
> I need a single rewrite rule.
>
> any ideas?
>
> -g.
>
>
>
>
> On Nov 6, 2007 5:33 AM, chris <prpht9 at gmail.com> wrote:
>
> > I'm on a debian based system which includes the following snip from the
> > main conf file. The "ServerName carl" entry is the hostname of the incoming
> > http request. The "VirtualHost *" is defining what ip interface to listen
> > on btw.
> >
> > chris at carl:/etc/apache2/sites-available$ cat carl
> > <VirtualHost *>
> >
> > LoadModule proxy_http_module
> > /usr/lib/apache2/modules/mod_proxy_http.so
> >
> > ServerName carl
> >
> > ProxyPass / http://localhost:9000/
> > ProxyPassReverse / http://localhost:9000/
> >
> > <Location />
> > Order allow,deny
> > Allow from 192.168.0.0/16
> > </Location>
> > </VirtualHost>
> >
> >
> > Your should look like this...
> >
> >
> > > <VirtualHost *>
> > >
> > > LoadModule proxy_http_module
> > > /usr/lib/apache2/modules/mod_proxy_http.so
> > >
> > > ServerName username.mydomain.com
> > >
> > > ProxyPass / http://www.mydomain.com:9000/
> > > ProxyPassReverse / http://www.mydomain.com:9000/
> > >
> > > <Location />
> > > Order allow,deny
> > > Allow from *
> > > </Location>
> >
> > <PUT_REWRITE_RULE_HERE to make / => /view/username />
> > > </VirtualHost>
> > >
> >
> > This should get you going, let me know if you have more problems I'll go
> > into more detail.
> >
> > -Chris
> >
> >
> >
> > On Nov 5, 2007 4:59 PM, George Moschovitis <
> > george.moschovitis at gmail.com> wrote:
> >
> > > please do so...
> > >
> > > thanks,
> > > -g.
> > >
> > >
> > > On Nov 5, 2007 11:32 PM, chris <prpht9 at gmail.com > wrote:
> > >
> > > > I think what you want is name based virtual host routing. I have a
> > > > sample configuration file at home. I'll post it here when I get there.
> > > >
> > > > Chris
> > > >
> > > > On 11/5/07, George Moschovitis <george.moschovitis at gmail.com> wrote:
> > > >
> > > > > Dear devs,
> > > > >
> > > > > I have a small apache question, hopefully someone can help.
> > > > >
> > > > > I would like to rewrite urls like:
> > > > >
> > > > > username.mysite.com
> > > > >
> > > > > to
> > > > >
> > > > > www.mysite.com/view/username
> > > > >
> > > > > everyone knows the exact RewriteCond/RewriteRule directives?
> > > > >
> > > > > thanks in advance,
> > > > > -g.
> > > > >
> > > > >
> > > > > --
> > > > > http://me.gr
> > > > > http://joy.gr
> > > > > http://cull.gr
> > > > > http://nitroproject.org
> > > > > http://phidz.com
> > > > > http://joyerz.com
> > > > > _______________________________________________
> > > > > Nitro-general mailing list
> > > > > Nitro-general at rubyforge.org
> > > > > http://rubyforge.org/mailman/listinfo/nitro-general
> > > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > Nitro-general mailing list
> > > > Nitro-general at rubyforge.org
> > > > http://rubyforge.org/mailman/listinfo/nitro-general
> > > >
> > >
> > >
> > >
> > > --
> > > http://me.gr
> > > http://joy.gr
> > > http://cull.gr
> > > http://nitroproject.org
> > > http://phidz.com
> > > http://joyerz.com
> > >
> > > _______________________________________________
> > > Nitro-general mailing list
> > > Nitro-general at rubyforge.org
> > > http://rubyforge.org/mailman/listinfo/nitro-general
> > >
> >
> >
> > _______________________________________________
> > Nitro-general mailing list
> > Nitro-general at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/nitro-general
> >
>
>
>
> --
> http://me.gr
> http://joy.gr
> http://cull.gr
> http://nitroproject.org
> http://phidz.com
> http://joyerz.com
>
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20071106/9842b1b4/attachment-0001.html
More information about the Nitro-general
mailing list