Patryk Cieszkowski
Patryk Cieszkowski

Reputation: 751

htaccess Faking directory path?

I would like to fake directory path with .htaccess, but I haven't got much experience with it, so I'm asking you, guys.

Let's say my URL is http://example.com/test and I got some scripts in that folder. I would like to hide the URL, so I wouldn't be able to access by it's real URL, but I could access it with e.g. http://example.com/test2.

I simply would like to hide and fake the directory.

Upvotes: 0

Views: 88

Answers (1)

Katherine
Katherine

Reputation: 639

To simply protect the page with a password you can add the following into your .htaccess on the page you want to protect:

AuthType Basic
AuthName "Password Protected Area"
AuthUserFile /path/to/.htpasswd <-- change this to your full path to .htpasswd
Require valid-user

Then create the .htpasswd file, and create user/password combinations. Like this:

test:dGRkPurkuWmW2

Directions can be found on this page:

http://www.htaccesstools.com/articles/password-protection/

Use a password generator like this one to generate an encrypted password:

http://www.htaccesstools.com/htpasswd-generator/

Upvotes: 2

Related Questions