Andrea Fabbri
Andrea Fabbri

Reputation: 63

Hiding folder .htaccess

I need to hide a folder from a url.

An example:

If I enter www.mysite.com/jango.php I need you to read the directory: www.mysite.com/users/jango.php but do not want to see /users I just want to see this in the address bar: www.mysite.com/jango.php

Upvotes: 0

Views: 537

Answers (2)

Praveen Kumar Purushothaman
Praveen Kumar Purushothaman

Reputation: 167250

Use this in your .htaccess:

RewriteEngine On
RewriteRule ^/users/([^/]*)$ /$1 [L]

Upvotes: 0

newman
newman

Reputation: 2719

You should use mod_rewrite

For you example rule will

RewriteRule ^jango\.php$ /users/jango.php

Upvotes: 3

Related Questions