Forum Moderators: phranque
Here is the .htaccess offending line :
RewriteRule ^subject/([0-9]*)-([a-z,\_,A-Z,\_,\',\.,\-,\&,\%,\$,\!,0-9]*)_([a-z,\_,A-Z,\-,\_,\',\.,\&,\%,\$,\!,0-9]*).html subject_details.php?bid=$1
Here is the error I get in the log
cannot compile regular expression '^subject/([0-9]*)-([a-z,\\_,A-Z,\\_,\\',\\.,\\-,\\&,\\%,\\$,\\!,0-9]*)_([a-z,\\_,A-Z,\\-,\\_,\\',\\.,\\&,\\%,\\$,\\!,0-9]*).html'\n
The error that I get in the browser is :
500 Internal Server Error
I'm pulling my hair out. Can anyone help ?
Thanks
RewriteRule ^subject/([0-9]*)-([a-z0-9_'.&%$!\-]*)_([a-z0-9_'.&%$!\-]*)\.html$ subject_details.php?bid=$1 [NC]
RewriteRule ^subject/([0-9]*)-([a-z0-9_.\-]*)_([a-z0-9_.\-]*)\.html$ subject_details.php?bid=$1 [NC]
See RFC 2396 - Uniform Resource Identifiers (URI): Generic Syntax [faqs.org] for more information.
It is unclear whether you want all except one "word" separated by underscores to be matched into the second or into the third sub-pattern. As the code is written now, all except the last underscore-separated word will be matched into the second by default. You should modify the sub-patterns to remove this ambiguity, and actually, there is no apparent need for the third sub-pattern with the current grouped characters sets.
In other words, it could just as well be written as
RewriteRule ^subject/([0-9]*)-[a-z0-9_'.&%$!\-]*\.html$ subject_details.php?bid=$1 [NC]
Jim
[edited by: jdMorgan at 4:11 am (utc) on Feb. 22, 2008]