INVALID POST DATA When Trying to Install Extension Key in Magento Connect
Sometimes when you try to install an extension with it’s key in Magento Connect, you may receive the following notice:-
INVALID POST DATA
This is caused by any index.php RewriteRule’s in your site’s .htaccess, for example, like the below:-
1 2 3 4 |
RewriteRule ^(.*)(index.php/admin)($|/) - [L] RewriteCond %{THE_REQUEST} ^.*/index.php RewriteRule ^(.*)index.php$ http://www.domain.com/$1 [R=301,L] RewriteRule ^index.php/(.*) $1 [R=301,QSA,L] |
In this instance, you would need to comment these lines out, for example:-
1 2 3 4 |
#RewriteRule ^(.*)(index.php/admin)($|/) - [L] #RewriteCond %{THE_REQUEST} ^.*/index.php #RewriteRule ^(.*)index.php$ http://www.domain.com/$1 [R=301,L] #RewriteRule ^index.php/(.*) $1 [R=301,QSA,L] |
Then you should be able to install using the extension key in Magento Connect and once you have installed the extension, you can reinstate the RewriteRule’s again by removing the hash (#) from those lines.
And in case you were wondering, the above code snippet strips index.php from all URL’s with the exception of the admin back end and 301 redirects all index.php URL’s to the version without index.php.