.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?

  1. remove contact directory.
  2. 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

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -