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

RE: [OT] webserver ?

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 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

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

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