Reputation: 13
Im using mod_rewrite to display adress of pages in more readable way, instead of
http://127.0.0.1/index.php?article=contact
i got
when im sending form, all is processed by index.php, so i direct action of form to currently displayed page but $_POST is always empty, opening block of form looks like this
<form method="post" action="http://127.0.0.1/contact">
before i launched mod_rewrite all was working great, but now mod_rewrite seems to cause problems.
Please tell me what to change in PHP, Apache configuration files, or what else to do to make $_POST work with rewrite endabled
Here are rewrite rules that was requested
RewriteEngine on
#RewriteCond %{HTTP_HOST} !^www\.
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteRule \.(css|jpe?g|gif|png)$ - [L]
RewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L]
RewriteRule ^([^/\.]+)/?$ index.php?page=$1 [L]
RewriteRule ^([^/\.]+)/([^/\.]+)/?$ index.php?page=$1&va=$2 [L]
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ index.php?page=$1&va=$2&vb=$3 [L]
Thanks in advance
Amir
Upvotes: 1
Views: 5956
Reputation: 14946
This rewrite rule does a redirect, so the browser will instead go to this address with a GET request; the POST data will therefore always be empty.
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L]
Upvotes: 2