Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 1st, 2002, 05:11 AM
smantscheff smantscheff is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Posts: 3 smantscheff User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #2  
Old March 1st, 2002, 03:44 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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]

Reply With Quote
  #3  
Old March 1st, 2002, 04:06 PM
smantscheff smantscheff is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Posts: 3 smantscheff User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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).

Reply With Quote
  #4  
Old March 1st, 2002, 04:09 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You need to escape the dot. This rule is a common sense in regex.

Reply With Quote
  #5  
Old March 1st, 2002, 04:47 PM
smantscheff smantscheff is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Posts: 3 smantscheff User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.]

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > rewrite/regex problem with apache/FreeBSD


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT