.htaccess - htaccess rewriterule preserve post data -
the address of contact form of website is
www.mysite.com/contact
and actual contact form address www.mysite.com/contact.php
when user fills contact form, want contact.php receive post data coming "/contact". created folder named contact , put .htaccess file content below
rewriterule (.*) /contact.php
but post data lost after form submitted , /contact redirected contact.php. ideas solve it?
- remove
contact
directory. put rule in htaccess file in document root
rewriterule ^contact/?$ /contact.php [l]
the reason why losing post data , getting redirected because if there contact
directory, , request /contact
, mod_dir module redirect /contact/
enforce trailing slashes requests directories. redirect , rewrite both applied , see /contact.php
.
Comments
Post a Comment