How do I display only the folder in the address bar, eg:
www.teste.com.br/admin
When it looks like this:
www.teste.com.br/admin/index.php
How do I display only the folder in the address bar, eg:
www.teste.com.br/admin
When it looks like this:
www.teste.com.br/admin/index.php
Enable mod_rewrite
in Apache, usually already enabled.
Use the following command:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^admin/?$ admin/index.php [NC,L]
</IfModule>
In RewriteRule
you tell the server that when the URL www.yourdomain.com/admin is accessed it should be interpreted as www.yourdomain.com/admin/index.php
Here the same question with htaccess
and IIS
Masking url path on IIS server
You can find more complex examples on the workings of friendly URLs link