There is a site on the old samopisny engine in php. The site has links of the form:
site.ru/index.php?page=services
site.ru/index.php?page=services&cat=category (1)
site.ru/index.php?page=services&cat=category&id=stranitsa
Configured CNC View Links
site.ru/services
site.ru/services/category (2)
site.ru/services/category/stranitsa
using the .htaccess file:
<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^([a-z0-9-]+)$ /index.php?page=$1 [L] RewriteRule ^([a-z0-9-]+)\/([a-z0-9-]+)$ /index.php?page=$1&cat=$2 [L] RewriteRule ^([a-z0-9-]+)\/([a-z0-9-]+)\/([a-z0-9-]+)$ /index.php?page=$1&cat=$2&id=$3 [L] </IfModule> It turns out that the page is available on two links (1) and (2). And it is necessary that from (1) there was a 301th redirect to (2). Tell me, please, how to do this?
I tried to write something like below below the above instructions:
RewriteCond %{QUERY_STRING} page=([^&]*)$ RewriteRule ^index.php /%1? [R=301] But going to site.ru/services is infinite loop forwarding.