Do not show file in plot bar

Asked

Viewed 75 times

0

How do I only show the folder in the address bar, e.g.:

www.teste.com.br/admin

Instead of showing up like this:

www.teste.com.br/admin/index.php

  • 2

    This is called Friendly URL and is configured by the . htaccess file.

1 answer

0

Activate the mod_rewrite in Apache, it is usually already activated.

Use the following command:

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule ^admin/?$ admin/index.php [NC,L]
</IfModule>

In the RewriteRule you tell the server that when the URL www.seudominio.com/admin is accessed it should be interpreted as www.seudominio.com/admin/index.php

Here the same question with htaccess and IIS Mask url path on IIS server

You can find more complex examples about how friendly Urls work http://blog.thiagobelem.net/aprendendo-urls-amigaveis-com-regras-complexas

  • 3

    Favor existing responses, http://answall.com/search?q=qremover+index

Browser other questions tagged

You are not signed in. Login or sign up in order to post.