I’ve got a magento install that is using the htaccess mod_geoip to redirect people from specific countries to other store fronts. It’s working like a charm (after I got it to ignore javascript and skin files), but I’m going to be having someone from Australia input some orders into the backend of magento.
The issue is that they can’t access the main backend at store/index.php/admin (they are rewritten to austore/index.php/admin) and when they go to put orders in, they are missing some integral components of the order process which I think is due to the url being rewritten to austore/index.php/admin. Wondering if there is a way that if the request uri is store/index.php/admin that they won’t get rewritten. My code is below from my htaccess:
RewriteRule ^(skin|js) - [L,NC]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(AQ|AU|MY|BV|BN|BN|MM|KH|CN|CX|CC|CK|GQ|FJ|PF|GU|GW|HM|HK|ID|KI|KR|KP|KR|LA|MO|MY|MH|FM|MM|NR|NC|PG|NZ|NU|NF|PG|CN|PH|PN|WS|SG|SB|KR|LK|BN|TW|TW|AU|TH|TL|TK|TO|TV|VU|VN|VN|WF)$
RewriteCond %{REQUEST_URI} ^/store(/.*)$ [NC]
RewriteRule ^ /austore%1 [L,R]
Thanks for the help!
Taken from this, http://www.sonassi.com/knowledge-base/magento-kb/secure-your-magento-admin/ you can use the same rewrite logic in what you want to do.
Just bear in mind, doing this through
.htaccesscould potentially cause some bizarre issues in the long run with 3rd party extensions, that have custom admin routes (that are not prefixed with /admin) break. So just be mindful of this.I would advocate the use of a Magento extension (PHP based), mod_geoip store switcher – as then you can make it apply only to the frontend area of the Magento store (to prevent the potential errors I’ve described above)