httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lee Fellows <lfell...@4lane.com>
Subject Re: mod_rewrite condition question (redirecting to a file)
Date Wed, 19 Jun 2002 15:56:42 GMT
On Wed, 2002-06-19 at 08:22, Dmitry Medvedev wrote:
> I need to redirect a particular client (I know its IP) to a particular file.
> The rule follows:
> 
> RewriteEngine     on
> RewriteLog     logs/rewrite.log
> RewriteLogLevel     3
> RewriteCond %{REMOTE_ADDR}     ^192\.168\.80\.240$
> RewriteRule ^/(.*)$     D:/2036/sites/240/804/www/dos/dos.shtml
> 
> The following appears in the log:
> 
> (2) init rewrite engine with requested uri /
> (3) applying pattern '^/(.*)$' to uri '/'
> (2) rewrite / -> D:/2036/sites/240/804/www/dos/dos.shtml
> (2) local path result: D:/2036/sites/240/804/www/dos/dos.shtml
> (2) prefixed with document_root to
> D:/2036/sites/240/804/wwwD:/2036/sites/240/804/www/dos/dos.shtml
> (1) go-ahead with
> D:/2036/sites/240/804/wwwD:/2036/sites/240/804/www/dos/dos.shtml [OK]

  Given this outcome, why not just change the rewrite rule to:
RewriteRule ^/(.*)$ /dos/dos.shtml ?

  According to the mod_rewrite documentation, in a per-directory
  configuration, the per-directory prefix is automatically removed
  for the pattern matching and automatically added after the
  substitution.
  The documentation memtions one exception:  If a substitution string
  starts with 'http://' then the directory prefix will _not_ be added
  and an external redirect or proxy throughput is forced.


> 
> The question: how can I avoid the "prefixed with document_root" operation?
> 
> ================================
> Developer Express inc. [http://www.devexpress.com/]
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message