How to make instagram-style urls

1

I made a FRIENDLY URL, which is as follows: I wanted the link to be like this: www.site.com/usuario1/ , ie when the guy puts www.site.com/usuario1 it would be redirected to www.site.com/usuario1/ .

My .htaccess is this and only works if you put without the bar at the end www.site.com/usuario1

Can you complement this htaccess for the above example?

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) profile.php?id=$1/ [QSA,L]

Yes, I want you to have the / at the end of the user name, I modified the .htaccess for this as they were speaking for you:     RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\..+$
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) /site/profile.php?id=$1/ [R=301,L]

It worked until the redirect, now the links are: site.com/profile.php?id=Usuario1/ I want so site.com/Usuario1/, the redirect worked now only the profile.php part? id = User1 went wrong.

    
asked by anonymous 28.02.2016 / 15:47

0 answers