hi, welcome to webune support forums.
a popular question from our valued customers is how they can check or test if apache htaccess files are working or if its allowed or enabled in their apacher web server configuration
today we are going to show you if it is working or not.
you can create the script yourself or you can download the complete script. see below for the attachment on this post.
first, we are going to create a new directory [or folder] lets call it 'test' - so be sure to FTP to your website and create a new directory called test in your web root directory. for example, my absolute path to my web root directory is:
/home/users/web/publich_htmlso when you FTP to your site and you create the 'test' directory it should be at
/home/users/home/users/web/publich_html/test and my website url would be:
http://www.example.com/test/ok, now that you have created a test directory, we are going to create a simple index.html file to make sure you have done things right. so open your text editor. i am using windows xp to write this tutorial, so windows comes with notepad. copy and paste the following into a blank notepad:
Hi, This is the index file. OK!
now save it as.. "index.html" [NOTE: when saving as... the file, make sure to put the quotes so notepad doesnt change the file name to index.html.txt - we dont need the .txt at the end. only index.html
ok, now upload index.html to the test dirctory and point your browser to your website. should be something like this:
http://www.example.com/test/index.html[NOTE: replace example.com with you domain]
when you open this url, you should see our message:
Hi, This is the index file. OK!
if you were able to see our message, then you did ok and you can proceed with the next step.
the next step is where it gets good. the first file we are going to create is called .htaccess - this file will be used by apache to find the password file. ok, open another blank notepad and type the following into notepad:
AuthType Basic
AuthName "Members Only"
AuthUserFile /home/users/web/publich_html/test/.htpasswd
<limit GET PUT POST>
require valid-user
</limit>
[NOTE: replace /home/users/web/publich_html/test/ with your OWN absolute directory. if you dont know what is your absolute directory contact your web hosting company, if you are a Webune customer, contact us and we can provide this information to you at no charge]
now save this file as ".htaccess"
[NOTE: when saving as... the file, make sure to put the quotes so notepad doesnt change the file name to .htaccess.txt - we dont need the .txt at the end. only .htaccess
after you have saved .htaccess - upload to our 'test' directory on your website
now the last file we are going to make is called .htpasswd - same deal, open a blank notepad and copy and paste the followin:
admin:01vokOibos3pg
now save this file as ".htpasswd "
[NOTE: when saving as... the file, make sure to put the quotes so notepad doesnt change the file name to .htpasswd.txt - we dont need the .txt at the end. only .htpasswd
after you have saved .htpasswd - upload to our 'test' directory on your website
ok, things are looking good. you should have three files in your test directory:
index.html
.htaccess
.htpasswd
now open your wesbite again:
http://www.example.com/test/index.html[NOTE: replace example.com with you domain]
if you get a popup asking your for a username and password, then you know that .htaccess is working ok
Congratulations!!!!
you can use these defaul login:
username: admin
password: password
:(
ok, how about if you dont get the login window, then that means probably you dont have htaccess enabled.
if you are a webune customer, please contact us, we will work with you to get this feature enabled in your apache web server
Webune Support Team
test-htaccess.zip