Cannot compile regular expression

Discuss practical ways rearrange URLs using mod_rewrite.

Postby analog » Mon Oct 15, 2001 12:48 am

I have a rule that I have been using on one server for several months now. it is:

RewriteEngine on

RewriteRule ^/forums/f([0-9]+)/s([^/]+?)$ /forums/forumdisplay.php?forumid=$1&s=$2 [L]

I need to move the site to another server, but that server is not liking this rule. Specifically, it is failing on the regex with this error:

RewriteRule: cannot compile regular expression '^/forums/f([0-9]+)/s([^/]+?)$'

I am sure this works on another server. Any ideas?
analog
 
Posts: 3
Joined: Sun Oct 14, 2001 4:00 pm

Postby Brett » Sun Oct 28, 2001 8:57 am

Hi Analog,

I really don't know anything about how different servers treat regular expressions, but it would certainly be an interesting discussion topic. All I can tell you is that your code doesn't work on my server, but the following appears to work:

RewriteEngine on
RewriteRule ^forums/f([0-9]+)/s([^/]+)$ forums/forumdisplay.php?forumid=$1&s=$2 [L]

I deleted the slash at the beginning, and the question mark near the end, of the regular expression. I hope this works for you.
Brett
 
Posts: 82
Joined: Tue Jul 10, 2001 4:00 pm
Location: yohost.com

Postby analog » Fri Nov 02, 2001 6:02 pm

yep, the problem was with the question mark in the regex... removing it fixed it.

What is weird is that the regex was working on the old server, so I think solving this problem may have just created more questions in my head :wink:

Thanks
analog
 
Posts: 3
Joined: Sun Oct 14, 2001 4:00 pm

Postby Guest » Wed Feb 27, 2002 5:30 pm

On 2001-11-02 21:02, analog wrote:
What is weird is that the regex was working on the old server, so I think solving this problem may have just created more questions in my head :wink:

Thanks


I just experienced the same thing except on the same server, except I'd only get that error with a version of apache with php compiled as a DSO. The version of apache with php compiled statically (same apache version) worked fine...
Guest
 


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron