views:

57

answers:

1

Hi all. I'm not so good on htaccess but was happy with what I had done so far until I noticed my $_post variables were not being processed because of the rewrite signiture within my htaccess file (SIGH)

My objective was to read the url and determine it's path and location from php and it's $_SERVER['request_uri'] method, which works fine. Everything after http://mydomain.com/ gets ripped apart and used as data hence the need for htaccess.

my htaccess:

AddType text/x-component .htc

Options +FollowSymlinks

<Files .htaccess>
 order allow,deny
 deny from all
</Files>

IndexIgnore *

ErrorDocument 404 /index.php?/

<FilesMatch "(\.jpe?g|gif|png|bmp)$">
  ErrorDocument 404 "File Not Found"
</FilesMatch>

RewriteEngine On

RewriteBase /
RewriteRule (.*)\.htm $1.php [L,NC]

my php: (baring in mind everything gets parsed through index.php)

The php is irrelevant to the problem as I know it should work. I have been testing the post variables by using print_r($_POST) and they are empty when submitted from a form. The obvious problem is down to my lack of knowledge with htaccess.

Just for this thread. lets say my index.php looked like this:

<?php

print_r($_POST);

?>

<form action="" method="post">
  <input type="text" name="test">
  <input type="submit" value="Test!">
</form>

online example here: www.blueaspect.com <-- The form works!

Then by adding foo/ to the end of the url you'll see the file loaded is still index.php. Which is what I want but now the form does not work.

Please if anyone could help that would be much appreciated

A: 
AddType text/x-component .htc

RewriteEngine On
RewriteBase /
RewriteRule (.*)?\.(sb|html|htm|php|asp|aspx)$ index.php

fixed that problem

Classical