views:

40

answers:

1
+1  A: 

You said you want to rewrite from http://website.com/chkreg.php?checkreg=34324234 to http://website.com/checkreg/34324234, but your rewrite rule is doing the opposite.

Use this:

RewriteRule ^chkreg.php?checkreg=(.*) /checkreg/$1 [L] 

Edit: If you need further debugging information from mod_rewrite then add the following:

RewriteLog /your/path/rewrite.log
RewriteLogLevel 3
Taylor Leese
I still get an error 500 with your fix, but thank for telling me about it being backwards. I used a .htaccess generator website to make it.. :P
Brad
I actuall want to rewrite from http://website.com/checkreg/34324234 to http://website.com/chkreg.php?checkreg=34324234 because there are a lot of copies of the software pointing to the old checkreg.
Brad
Then your original rule looks correct. You should check the rewrite logs to see what is going on. Are you able to use the checkreg/34324234 url directly?
Taylor Leese
When your rule is 'RewriteRule A B' that means people type 'A' in their browser and you want them to access 'B' on your server.
bmb
I can access website.com/chkreg.php?checkreg=45345345 directly without issue, but when I go to website.com/checkreg/34324234 I get an error 500. I'm checking logs now. Thanks for the help so far.
Brad