httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ya Netu <eco...@hotmail.com>
Subject RE: [users@httpd] Using Rewrite
Date Wed, 12 Aug 2009 22:30:38 GMT

i have some waht similar questiin for debuging my rewrite policy:

How can I tell if my rewrite is being executed if I get 404 error. Any way to trce if rules
is executed and that it was trying to do redirect? tnx
 
> From: bobsiegen@googlemail.com
> Date: Wed, 12 Aug 2009 21:20:24 +0200
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Using Rewrite
> 
> 2009/8/12 Alexis <rab4585@gmail.com>:
> > ok, then the code would be
> > RewriteCond %{HTTP_HOST} ^files\.example\.com$ [NC] RewriteRule ^(.*)$
> > /files/public$1 [L]
> > or am i wrong?
> 
> Unless you put RewriteEngine off in a .htaccess file located in your
> files/public/ folder, that would result in an infinite loop. But only
> if you correct your rule. Since there is no leading slash in the
> string tested against your regular expression in .htaccess files,
> you'd rewrite to /files/publicarchivo.txt instead of
> /files/public/archivo.txt
> 
> # we can change to a lex. equal comparison here
> RewriteCond %{HTTP_HOST} =files.example.com [NC]
> # exclude th folder
> RewriteCond $1 !^/files/public/
> RewriteRule ^(.*) /files/public/$1 [L]
> 
> 
> Setting the DocumentRoot for files.example.com in your httpd.conf to
> /home/example/public_html/files/public would be another (may be the
> regular) approach.
> 
> Bob
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

_________________________________________________________________
Get back to school stuff for them and cashback for you.
http://www.bing.com/cashback?form=MSHYCB&publ=WLHMTAG&crea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1
Mime
View raw message