Url friendly with folder

1

I have the following doubt:

You can turn this url: link

In: link

Can you do this? I tried to do this in my .htaccess and I could not (I know almost nothing about it).

Note: "usercenter" is a folder.

    
asked by anonymous 02.11.2017 / 21:48

1 answer

1

Only for user home

RewriteEngine On

# http://localhost/newera/user/home
# -->  http://localhost/nomeprojeto/usercenter/index.php?user=home
RewriteRule ^newera/user/home/?$ nomeprojeto/usercenter/index.php?user=home [NC,L,QSA]


For any text:

RewriteEngine On

# http://localhost/newera/user/qualquer-texto
# -->  http://localhost/nomeprojeto/usercenter/index.php?user=qualquer-texto
RewriteRule ^newera/user/([^/]+)/?$ nomeprojeto/usercenter/index.php?user=$1 [NC,L,QSA]
    
22.11.2017 / 08:30