I’m using a .htaccess file to rewrite the url. It makes localhost/16 the same as localhost/profile.php?p=16. This works. However, when i go to localhost/16 the URL reverts to localhost/profile.php?=16. I would like it to say as localhost/16 while the user is on the page. How can i do this?
.htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .* - [L]
RewriteRule ^(.*)$ http://localhost/profile.php?p=$1 [NC]
Don’t use the full URL – that implies [R] (redirect)