Skip to content

Instantly share code, notes, and snippets.

@s2ar
Last active April 23, 2016 08:23
Show Gist options
  • Save s2ar/7271ee7326728274825d to your computer and use it in GitHub Desktop.
Save s2ar/7271ee7326728274825d to your computer and use it in GitHub Desktop.
Bitrix.urlrewrite
<?php
array(
"CONDITION" => "#^/weather/([^/]+)/([^/]+)/($|index\\.php|\\?.*)#",
"RULE" => "COUNTRY_CODE=$1&CITY_CODE=$2",
"ID" => "",
"PATH" => "/weather/city.php",
),
/*
/weather/russia/moscow/ => /weather/city.php?COUNTRY_CODE=russia&CITY_CODE=moscow
/weather/russia/moscow/index.php => /weather/city.php?COUNTRY_CODE=russia&CITY_CODE=moscow
/weather/russia/moscow/?whatever => /weather/city.php?COUNTRY_CODE=russia&CITY_CODE=moscow
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment