Smarty在使用控制器时美化网址

I found this post which matches my needs the most, I just didnt get this to work fully for my needs. How can I change the URL in the browser by htaccess?

I have url's like these:

mysite.de/index.php?cl=services

I'd love to have something like this:

mysite.de/services

What is the easiest way to do so?

RewriteRule ^profile/([0-9]+)/([A-Za-z0-9-]+)/?$ index.php?p=profile&id=$1

Should work for :

www.domain.com/index.php?p=profile&id=20

to

www.domain.com/profile/20/profile-friendly-name

For your particular example it would be

Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteRule ^services$ /index.php?cl=services [L]

If you need multiple URLs you need multiple RewriteRules. Or you could group them together (i.e. RewriteRule ^(services|contact)$ /index.php?cl=$1), but multiple rules is way easier to read and maintain.