urlrewrite.php

ЧПУ своими руками

16.03.2013 php, php скрипты No comments

<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteRule ^catalog/([^/.]+)/([^/.]+)/?$ catalog/index.php?SECTION_CODE=$1&ELEMENT_ID=$2 [L]
	RewriteRule ^catalog/([^/.]+)/?$ catalog/index.php?SECTION_CODE=$1 [L]
</IfModule>

urlrewrite.php

24.03.2012 Bitrix No comments ,

Пример файла urlrewrite.php

$arUrlRewrite = array(
	array(
		"CONDITION"	=>	"#^/catalog/(.*)/(.*)/\\?*(.*?)$#",
		"RULE"	=>	"SECTION_CODE=$1&ELEMENT_ID=$2",
		"ID"	=>	"",
		"PATH"	=>	"/catalog/detail.php",
	),
	array(
		"CONDITION"	=>	"#^/catalog/(.*)/\\?*(.*?)$#",
		"RULE"	=>	"SECTION_CODE=$1",
		"ID"	=>	"",
		"PATH"	=>	"/catalog/index.php",
	),
);