You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Rob Perelman <ro...@vrob.com> on 2003/03/17 04:32:16 UTC
[users@httpd] Weird mod_rewrite problem
I've been using mod_rewrite with Apache for some time now, but recently
I've been getting occasional "Internal Server Error" messages. I
discovered that the mod_rewrite rule below was causing the error. The
rule looks like this:
RewriteCond %{DOCUMENT_ROOT} /([^/]+)/?$
RewriteRule ^ - [env=HOST:%1]
The error_log shows the following when the ISE comes up:
www.x.com [Mon Mar 3 16:17:53 2003] [alert] [client x.x.x.x] /x/.htaccess:
RewriteCond: cannot compile regular expression '/([^/]+)/?$'
What makes no sense to me is that 99% of the time it works just fine, but
1% of the time it doesn't. How would the rewrite engine not be able to
compile the regex only some of the time!? All I'm trying to do is extract
the last piece of the document root to determine what site the user is
viewing. Hence a document root of /usr/www/users/username/x.com/ would
yeild "x.com" being set in the environment variable HOST. Any mod_rewrite
experts willing to help?
--
Rob Perelman :: rob@vrob.com :: http://www.vrob.com
---------------------------------------------------------------------
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