0

Firstly, apologies if this is in the wrong place, I couldn't find an alternative topic where this would be more relevant. Feel free to move it if you can think of a better place for this thread.

I've been encountering an issue with apache's mod_rewrite that I can't find a solution to - tried googling the problem, and checked apache's mod_rewrite manual (wow not helpful at all), and re-read heaps of tutorials regarding mod_rewrite.

This is the rewrite rule which fails:

RewriteRule ^course/filter:([a-zA-Z0-9_-\,\=]+)$ php/manage_courses.php?display=list&filter=$1 [L]

Note the "\,\=" bit is the specific area which causes the server to return a 500 Internal Server Error.

In the apache error log:

[Wed Jan 27 16:29:31 2010] [alert] [client ::1] H:/SVN/prj_us/.htaccess: RewriteRule: cannot compile regular expression '^course/filter:([a-zA-Z0-9_-\\,\\=]+)$', referer: http://localhost/~svn/prj_us/php/admin_index.php

As you can see it seems to be attempting to automatically escape the "\"s... which it shouldnt be doing. I need to allow = and , in my URL... any suggestions?

Other notes:
- works without the "\,\=" part, but i need those two chars in particular for the URL that I am trying to rewrite.
- all other regexps in the .htaccess file work, although they dont have the two chars as above.

cheers for your help.

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by pritaeas
0

There should be no need to escape the , or the =

Iirc the only characters that need escaping are: * . $ + [ ]

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.