Previously I used my url in the following way
http://www.nombredelaweb.com/rubro.php?id=juguetes-magicos
I get the value of the variable like this:
$variable = trim($_GET["id"]);
Now I update and in the htaccess file add the following lines
Options +FollowSymLinks
RewriteEngine on
Rewriterule ^rubro/([a-zA-Z0-9_-]+).php rubro.php?id=$1
Format of my new url
<a href='http://www.nombredelaweb.com/rubro/juguetes-magicos.php'>Ver nombre</a>
I get the value of the variable like this:
$variable = trim($_GET["id"]);
In this way I get my url to be more friendly.
My question: It is necessary to create a folder inside my hosting with the name (item) and inside this the file (juguetes-magicos.php) since my web would be like this (www.nombredelaweb.com/ rubro / juguetes-magicos.php)
Previously it was not necessary since the variable was in the file that did exist followed by the variable and it was rubro.php? id = juguetes-magicos.
I hope you understand me. Thank you very much.