[OT] webserver ?

Alexander Dalloz alexander.dalloz at uni-bielefeld.de
Wed May 5 16:16:30 UTC 2004


Am Mi, den 05.05.2004 schrieb MW Mike Weiner (5028) um 17:22:

> > RewriteEngine on
> > RewriteCond %{HTTP_HOST} !^www\.      [NC]
> > RewriteCond %{HTTP_HOST} !^$
> > RewriteRule ^(.*)        http://www.%{HTTP_HOST}/$1   [R=301]
> > 
> > (I hope it will survive line wrapping, above instructions are 4 lines)
> > 
> > See: http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html for further
> details.
> 
> This works well for the w, ww, and subscequent www(x) requests, now I
> have 1 step left, I need to add the same redirect behavior for JUST the
> domain (i.e. blah.com) without the w's in front, again, send the client
> the 301 and redirect to http://www.blah.com
> 
> Thanks.
> Michael Weiner

 Didn't you read the mod_rewrite documentation? You should be able to
answer that question yourself.

The rules above should already redirect each request, where the HTTP
host does not start with www. Not necessary should be a further line:

Rewrite Cond %{HTTP_HOST} ^blah\.com	     [NC]

Alexander


-- 
Alexander Dalloz | Enger, Germany | GPG key 1024D/ED695653 1999-07-13
Fedora GNU/Linux Core 1 (Yarrow) on Athlon CPU kernel 2.4.22-1.2188.nptl
Sirendipity 18:07:37 up 8 days, 16:56, load average: 0.18, 0.17, 0.18 
                   [ Γνωθι σ'αυτον - gnothi seauton ]
             my life is a planetarium - and you are the stars
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20040505/edd3f135/attachment-0001.sig>


More information about the fedora-list mailing list