:( .... как это понять?

ю, как сделать перезапись URL, например:www.example.com/index.php?id=1&cat=3 вwww.example.com/1/3/ (или что угодно). Я знаю это.

Чего я не знаю, так это как изменить все мои ссылки на всех страницах, чтобы они ссылались на красивые URL. Все ссылки моего сайта устарели (<a href="index.php?id=1&cat=2">) и таких много.

Я спрашиваю, есть ли у кого-то идея или знать, как автоматически перенаправить на этот красивый URL-адрес, если пользователь нажимает index.php? Id = 1. (Почти как этот сайт Stackoverflow, если вы измените заголовок в URL).

Итак, мои предположения ...

Используйте .htaccess для чтения index.php? Id = 1 и cat = 2, чтобы переписать index / 1/3, который сам интерпретирует снова (странно)

PHP-файл, чтобы сделать перенаправления, которые htaccess переписывает обратно в оригинал ...

Вывод: изменить<a href="index.php?id=1&....."> автоматическиindex/1/2

РЕШИТЬ
Options +FollowSymLinks
RewriteEngine On
RewriteBase /

##################################
# This turns index.php?id=1&cat=2 into index/1/2 and then back 'transparent' into    index.php?id=1&cat=2 if you have old fashioned
# links in your site and don't want to change them :)


# Avoid mod_rewrite infinite loops 
# This is critical if you want to use this code

RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [L]

# Hard-rewrite ("[R]") to "friendly" URL.
# Needs RewriteCond to match original querystring.
# Uses "?" in target to remove original querystring,
#   and "%n" backrefs to move its components.
# Target must be a full path as it's a hard-rewrite.
RewriteCond %{QUERY_STRING} ^id=(\d+)&cat=(\d+)$
RewriteRule ^index.php$ http://localhost/index/%1/%2/? [L,R]

# Soft-rewrite from "friendly" URL to "real" URL.
# Transparent to browser.
# Won't re-trigger the above rewrite, though I'm
#   not really sure why! The order of the rules
#   doesn't seem to make a difference.
RewriteRule ^index/(\d+)/(\d+)/$ index.php?id=$1&cat=$2 [L]

Ответы на вопрос(2)

Ваш ответ на вопрос