how to work with friendly url

Asked

Viewed 122 times

0

I have a site that does not use URL friendly my URL this so http://site/download/program? id=1&cat=113&dev=1 and it passes the parameters only I want the URL to look like this http://site/download/Avast-free-Antivirus in my htaccess to try to make friendly I did so:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /download/programa.php?id=$1&cat=$2&dev=$3 [L]

Here comes the problem with do so that when accessing by name is pulled id, the category and dev that and developer?

And how I create the same condition for another page?

1 answer

0

To do this via . htaccess should look like this the rule:

RewriteEngine on

RewriteRule ^download/avast-free-antivirus$  ./download/programa?id=1&cat=113&dev=1

And so on, but I must warn you that this is not the best way to perform that function. I did not find good material in PT-BR, but if you know English I advise reading that article

  • has how to make dynamic the part of Rewriterule download/Avast-free-Antivirus? ie when I type in the url the value is passed to the download/Avast-free-Antivirus$ if I type in the url avg-Antivirus there should be so download/avg-Antivirus$

Browser other questions tagged

You are not signed in. Login or sign up in order to post.