views:

611

answers:

1

I am trying to submit a form to the url "localhost/login". Inside my login directory I have an index.php file with the code I am using to debug that the post is working:

<?php
echo $_POST['username'];
?>

I have a .htaccess file inside my login directory:

RewriteEngine on
RewriteRule ^. index.php [L]

The problem is, when I post to localhost/login my firebug shows that the initial POST goes through, but then redirects to login.php as a GET request without any POST variables...

POST http://localhost/login?password=test_password&amp;remember=true&amp;username=test_username 301 Moved Permanently

GET http://localhost/login/ 200 OK

Any tips would be great.

Thanks

A: 

Based on my research, POST should be allowed to be rewritten and come out as POST, any sort of problem is probably due to something else going wrong, like your code.

Btw, in general, to keep the GET parameters from being stripped, use the QSA directive:

[QSA,L]

Artem Russakovskii