|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
rewrite/regex problem with apache/FreeBSD
I've transferred a Linux apache installation to a FreeBSD server. Now I've got problems with the rewrite engine:
In .htaccess are lines like: RewriteRule ^([A-Z])(.*) xyz.php?a=$1 Apache keeps writing in the error log messages like this: httpd in malloc(): warning: recursive call [Fri Mar 1 11:59:26 2002] [alert] [client 195.94.94.41] /usr/local/httpd/htdocs/qm-dev/.htaccess: RewriteRule: cannot compile regular expression '^([A-Z])(.*)' And it keeps displaying an Internal Server Error (Configuration Error) to the user in irregular intervals. What is going wrong? |
|
#2
|
|||
|
|||
|
Because it's not a valid regex. Try:
^[A-Z]*$ BTW, if you are trying to let xyz.php to handle all request in /qm-dev/ URI you should: RewriteEngine on RewriteRule ^[A-Z]*$ /usr/local/httpd/htdocs/qm-dev/xyz.php?a=$1 [T=application/x-httpd-php,L] |
|
#3
|
|||
|
|||
|
Thank's for the hint. But:
1) The regex's I'm using ran without problems under several flavours of linux, and I cannot see anything wrong in them. There are other lines in .htaccess like RewriteRule F([0-9]+)(.htm(l)?)? F-$1.html which also lead to those error messages when uncommented. You see that I need the brackets for getting parts of the request URI as parameters in other URIs. 2) Any regex I have in .htaccess leads to those error messages. 3) The error messages start only after some heavy load on the server, not right away. From then on, they remain until the server is restarted. With less server load, those regex's don't produce any error messages. 4) In spite of the error messages, the rewriting works as intended (and as it did under Linux). |
|
#4
|
|||
|
|||
|
You need to escape the dot. This rule is a common sense in regex.
|
|
#5
|
|||
|
|||
|
But escaping the dot would only make the dot a literal "." and not a symbol for any char. It would alter the semantics, but not affect the validity of the regex.
Also, now with little load on the server it works quite fine without complaining. There are other strange error messages from heavy load periods, too - I'll open a new topic for them; this doesn't seem to be a regex problem, after all. [I'd be glad if you joined.] |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > rewrite/regex problem with apache/FreeBSD |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|