.htaccess RewriteEngine转换链接而不更改链接

I'm on my begining of learning PHP and very first steps of .htaccess, most of my new web is about main category and few subcategories. Here are links examples i had before working out .htaccess RewriteEngine:

  • example.com/index.php?cat=email
  • example.com/index.php?cat=about&show=some

with help of .htaccess RewriteEngine i've convered them to:

  • example.com/email/
  • example.com/about/some/

Here is part of .htaccess:

RewriteRule ^([A-Za-z0-9-]+)/$ index.php?cat=$1 [L]
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/$ index.php?cat=$1&show=$2 [L]
RewriteRule ^([A-Za-z0-9-]+)$ index.php?cat=$1 [L]
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-]+)$ index.php?cat=$1&show=$2 [L]

Now problem is that most of content have inside links like: "example.com/index.php?cat=about&show=some" Changing them all is option, but anyway... is there anything else could be done? I heard of some .htaccess option that autoconverts links to format you need without changing them manualy, so all links in PHP pages will be the same, but once user gets page loaded, links will be like (example.com/about/some/) Is there anything like that, or is there any other option to leave original link without changing them all?

Cheers!

Links on your site are created with your PHP scripts, Apache with htaccess can't magically change all this links in a raw.

Now what you can do, is redirect old URL to the new ones using htaccess, with a 301 redirection.

For example, if someone click on example.com/index.php?cat=email, Apache will redirect (= the URL will be changed and there will be another HTTP request) to example.com/email/, and then rewrite this to index.php?cat=email

Add this to your htaccess :

RewriteCond %{REQUEST_FILENAME} index.php$
RewriteCond %{QUERY_STRING} cat=([a-zA-Z0-9-]+)
RewriteRule ^ http://example.com/%1/? [L,R=301]

Anyway I strongly recommend you to change the links directly in your code, because even if the solution I've just explained should works (not tested), it's not really healthy to use redirection when you can avoid them.