httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Greenwood <>
Subject [users@httpd] rewriterule causing [redirect/302] error
Date Tue, 04 Oct 2005 23:42:42 GMT
I am using Apache 2.0.54. I am having difficulty with the following

# See if the requested page is
RewriteCond %{SERVER_NAME} <>
# It is. Now see if " <>" is a folder in the
webcontent/ directory
RewriteCond %{DOCUMENT_ROOT}/webcontent/%{SERVER_NAME} -d
# it is.
RewriteRule ^/(.*)$ http://%{SERVER_NAME}%{REQUEST_URI} [S=5]

This produces the following output in rewritelog:

(2) init rewrite engine with requested uri /
(3) applying pattern '^/(.*)$' to uri '/'
(4) RewriteCond: input=' <>' pattern=' <>' => matched
(4) RewriteCond: input='C:/egranary/webcontent/' pattern='-d' =>
(2) rewrite / ->
(2) implicitly forcing redirect (rc=302) with
(1) escaping for redirect
(1) redirect to [REDIRECT/302]

The above 8-line log sequence repeats itself a few thousand times per
My intention is to filter the request ' <>',
check to see if there exists a directory called

in a local directory called 'webcontent', and if there is, ignore the page
in that local directory and retrieve the actual page from<>.
I realize this seems like a strange thing to do - it is for a configuration
which normally serves pages out of the local webcontent folder,
due to little and/or unreliable Internet connectivity. In this example, ' <>' would be an important enough
page to get the most current version. Note that the '[S=5]' in the
rewriteRule is just skipping the rest of the
rules and conditions. The two rewriteconds seem to be doing their intended
jobs, the rewriterule is not retrieving the page
from the Internet. I appreciate any ideas.
-Josh Greenwood

View raw message