I would like to add a bit of .htaccess wizardry to an existing .htaccess file (see https://github.com/silverstripe/silverstripe-installer/blob/master/.htaccess):
<IfModule mod_rewrite.c>
SetEnv HTTP_MOD_REWRITE On
RewriteEngine On
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* framework/main.php?url=%1 [QSA]
</IfModule>
so that if the URL starts with nz / au / us then this first segment is removed from the "url-get variable" created and added as its own get variable.
e.g.
[domain name goes here]/nz/my/page/is/here/
is redirected to:
main.php?url=/my/page/is/here/&country=nz
[domain name goes here]/au/my/other-page/is/here/
is redirected to:
main.php?url=/my/other-page/is/here/&country=au
[domain name goes here]/my/third-page/is/here/
is redirected to:
main.php?url=/my/third-page/is/here/