I'm trying to make my site's URLs friendly.
Friendly URL
http://localhost/mg/artista/10
.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^/artista/([0-9]+)$ /artista.php?artista=$1
</IfModule>
PHP to retrieve the variable
$artista = $_GET['artista'];
You are giving the following error: Notice: Undefined index: artist
I saw in some places the personnel recovering the variable using $ _SERVER ['REQUEST_URI']. If I use this, it returns me: / mg / artist / 10. By giving an explode I could get the variable, but I do not know if this is the correct way.