I have the following URL:
www.site.com.br/www/login.php
And I wanted to leave it like this:
www.site.com.br/login
How can I do this through .htaccess?
I have the following URL:
www.site.com.br/www/login.php
And I wanted to leave it like this:
www.site.com.br/login
How can I do this through .htaccess?
Hello,
You can use mod_rewrite to do this.
1) create an .htaccess file in the root of your server directory;
2) type RewriteEngine On
in the first line of the file.
3) create a rule for URL redirection.
ex:
Your URL: link
Desired URL: link
Your file will have the line:
RewriteRule ^/novo$ /site.php?ind=1&cod=novo [NC]
It may be a bit confusing at first, but you can find more information about it here:
link
and here too:
link
This rule should resolve:
RewriteEngine ON
RewriteRule ^www/(.*)$ $1 [L,QSA]
"More details can be found" below:
You can test it here .