Forum Moderators: phranque

Message Too Old, No Replies

htaccess, cannot compile regular expression?

         

aerotwelve

9:45 pm on Oct 18, 2007 (gmt 0)

10+ Year Member



Hello,

I am getting a 500 Internal Server Error due to this .htaccess file, or so my error log says.

[Thu Oct 18 14:32:56 2007] [alert] [client #*$!] directory/.htaccess: RewriteRule: cannot compile regular expression '^system/([a-z0-9\\-]+)$?'

I am fairly new to htaccess, what am I doing wrong? Htaccess file is here:


#php_flag magic_quotes_gpc Off
AddType application/x-httpd-php .php

Options -MultiViews -indexes
ErrorDocument 404 /404.php

RewriteEngine On

RewriteRule ^system/([a-z0-9\-]+)$? system.php?system=$1 [QSA]
RewriteRule ^list/([a-z0-9\-]+)/([a-z0-9\-]+)$? system.php?system=$1&list=$2 [QSA]

RewriteRule ^game/([a-z0-9\-]+)$? game.php?game=$1 [QSA]
RewriteRule ^review/([a-z0-9\-]+)$? review.php?review=$1 [QSA]

Thank you!

phranque

10:54 pm on Oct 18, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



try switching the dollar signs and question marks.

g1smd

11:46 pm on Oct 18, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Some dollar signs don't need to be touched.

Change each $? to be ?$ only.

phranque

7:05 am on Oct 19, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Some dollar signs don't need to be touched.

Change each $? to be?$ only.

what g1smd said is what i was trying to say...

aerotwelve

12:52 pm on Oct 19, 2007 (gmt 0)

10+ Year Member



Well, I think it fixed the error on one line, but it still isn't working...

[Fri Oct 19 05:49:43 2007] [alert] [client #*$!] directory/.htaccess: RewriteRule: cannot compile regular expression '^list/([a-z0-9\\-]+)/([a-z0-9\\-]+)$?'

Anyone have any ideas?

g1smd

1:33 pm on Oct 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Errr. You still have $? in it.

aerotwelve

9:28 pm on Oct 19, 2007 (gmt 0)

10+ Year Member



Ack, I'm sorry, didn't catch that one. Thanks for the help, it works now.

g1smd

11:58 pm on Oct 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Been there. Done that.

Real easy to miss a simple typo for hours and hours and hours...