[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] [RAQ4] Rewrite rule Help



Randal, Sorry let me be more clear. We offer users with the option to have a
username.domain.com as opposed to the domain.com/~username. If I use your
method I have to edit the httpd.conf2 file for every user I create correct?
If at all possible I would like to avoid this. Is there a way to do a
rewrite rule in a htaccess file. I found this at
http://www.apache.org/docs/misc/rewriteguide.html

<snip>Virtual User Hosts

Description:
Assume that you want to provide www.username.host.domain.com for the
homepage of username via just DNS A records to the same machine and without
any virtualhosts on this machine.

Solution:
For HTTP/1.0 requests there is no solution, but for HTTP/1.1 requests which
contain a Host: HTTP header we can use the following ruleset to rewrite
http://www.username.host.com/anypath internally to /home/username/anypath:
RewriteEngine on
RewriteCond   %{HTTP_HOST}                 ^www\.[^.]+\.host\.com$
RewriteRule   ^(.+)                        %{HTTP_HOST}$1          [C]
RewriteRule   ^www\.([^.]+)\.host\.com(.*) /home/$1$2
</SNIP>

I've tried this but cant get it to work. Any Ideas.

Trying to make this as easy as possible. If possible!
John Cordeiro



-----Original Message-----
From: cobalt-users-admin@xxxxxxxxxxxxxxx
[mailto:cobalt-users-admin@xxxxxxxxxxxxxxx]On Behalf Of Randall Clark
Sent: Thursday, November 09, 2000 4:36 PM
To: cobalt-users@xxxxxxxxxxxxxxx
Subject: Re: [cobalt-users] [RAQ4] Rewrite rule Help


Put the following line at the very top of your httpd.conf  file located in
/etc/httpd/conf
Include /etc/httpd/conf/httpd2.conf

Make a new file called httpd2.conf in the /etc/httpd/conf dir.
Put this in your new httpd2.conf file

# Included file for (httpd.conf)
#
#
#www.domain.com
<VirtualHost 000.000.000.000>
ServerAdmin user@xxxxxxxxxx
 DocumentRoot /home/sites/site#/users/username/web
ServerName www.domain.com
</VirtualHost>

#domain.com
<VirtualHost 000.000.000.000>
ServerAdmin user@xxxxxxxxxx
 DocumentRoot /home/sites/site#/users/username/web
ServerName domain.com
</VirtualHost>

Make sure you replace the IP address with your own IP address of the site.
You will see <VirtualHost 000.000.000.000>  make sure that the 0's are
replaced with your IP address.

Restart Apache using this  /./etc/rc.d/init.d/httpd restart

Randall Clark



----- Original Message -----
From: "John Cordeiro" <jcordeiro@xxxxxxxxxxxxxxx>
To: "Cobalt Users List" <cobalt-users@xxxxxxxxxxxxxxx>
Sent: Wednesday, November 08, 2000 4:20 PM
Subject: [cobalt-users] [RAQ4] Rewrite rule Help


> I'm trying to create a rewrite rule in httpd.conf. I am trying to rewrite
> www.domain.com/~user to www.user.domain.com has anyone done this this way
or
> is there a better way to do this. I searched the apache docs but cant find
> the specifics. Any help
>
> Thanks.
>
> _______________________________________________
> cobalt-users mailing list
> cobalt-users@xxxxxxxxxxxxxxx
> To Subscribe or Unsubscribe, please go to:
> http://list.cobalt.com/mailman/listinfo/cobalt-users
>

_______________________________________________
cobalt-users mailing list
cobalt-users@xxxxxxxxxxxxxxx
To Subscribe or Unsubscribe, please go to:
http://list.cobalt.com/mailman/listinfo/cobalt-users


_______________________________________________
cobalt-users mailing list
cobalt-users@xxxxxxxxxxxxxxx
To Subscribe or Unsubscribe, please go to:
http://list.cobalt.com/mailman/listinfo/cobalt-users