May 28, 200917 yr Hello, i need help with url, i want to have url without extension and i don't know how to get variable from url where there are no extension. My url looks like: www.site.com/profile.php i can make url like: www.site.com/profile.php?username=john but i want to look like: www.site.com/profile/john and i don't know how to GET that variable (john) i just know that url without extension can be done with htaccess, that's all i know thnx people
May 28, 200917 yr You mention .htaccess, so you probably are looking for an Apache solution, namely mod_rewrite. Something like this in /profile/.htaccess should do the trick: RewriteEngine On RewriteRule ^/(.*)$ /profile.php?username=$1
May 29, 200917 yr A pretty simple tutorial for mod_rewrite can be found at http://www.htmlist.com/how-to/a-simplemod_rewrite-tutorial/
Create an account or sign in to comment