Help .htaccess URL's Friendly

1

Hello,

I'm developing an online compiler, similar to IdeOne , and would like users to be able to access some of their codes already made on the site so simpler. I currently use a page codAnterior.php for this, I pass it by GET the code ID, so the url gets, www.site.com/Compilador/codAnterior.php?id=1 , I would like it to be www.site.com/Compilador/1 .

For this I saw that you can use .htaccess, I thought about using the following code, but I do not know if it's right.

RewriteEngine On 

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^Compilador\/([a-z,0-9,A-Z,_-]+)\/?$ codAnterior.php?id=$1
    
asked by anonymous 30.10.2016 / 01:23

0 answers