Forum Moderators: phranque
I recently wrote this code for a website I work for which works great except for one issue:
Options FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^somesite\.us
RewriteCond %{REQUEST_URI} ^/?$ [OR]
RewriteCond %{SERVER_PORT}!443
RewriteRule (.*) [somesite.us...] [R=301,L]
"RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.html\ HTTP/
RewriteRule ^(.*)index\.html$ [somesite.us...] [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ [somesite.us...] [R=301,L]
The administrator of the website and hosting has stated:
Your problem is in your chain, you will redirect a POST request to an index.php page to the index.php page via a GET request, thus breaking the functionality"
Any help regarding this issue as quite frankly I am not entirely suer what he means.
Thanks and Happy New Years Guys!
If you POST only to "/" in your canonical domain, then there is no problem.
You can disable the redirect for POSTs to index.php by making this change to your third rule:
RewriteCond %{THE_REQUEST} !^POST\ /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ http://www.example.com/$1 [R=301,L]
BTW, your admin guy is very good to spot such a problem... :)
Jim