Tuesday, May 22nd

Last update05:36:30 AM GMT

Font Size

Screen

Profile

Layout

Menu Style

Cpanel
Welcome, Guest
Username Password: Remember me

password-protecting index.php
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: password-protecting index.php

password-protecting index.php 4 years, 6 months ago #99

  • dex
  • OFFLINE
  • Moderator
  • Posts: 779
  • Karma: 12
Hi all

Ok, dumb question...

I want to password protect index.php on a client's development site, where Joomla is sitting in the same directory as the live HTML site.

I can't protect the directory or the live site will disappear.

So I read up on it and tried to use .htaccess, but what happens is that it just gives me a 403 access denied message, rather than asking me for a user name and password.

This is ticking me off proper!

.htaccess code:
AuthName EnterPassword
AuthType Basic
AuthUserFile /host_path_of_site/.htpasswd
AuthGroupFile /dev/null

require user tft


.htpasswd code
tft:tf2JYxeOoS.g2


For simplicity I have put both .htaccess and .htpasswd in the web directory. I know this is not where .htpasswd should go, but until I get it to work properly, that's where it is. I have also been careful with the names of the files and copying them up in ASCII not binary.

I have also checked the host path - it's the same as Joomla uses and Joomla is working!

What am I doing wrong? Can anyone spot it?

Thanks
Dex Randall
Joomla! web design and production
Sydney JUG organiser + joomla.org.au site admin
www.spikesystems.com.au
www.twitter.com/dexx

Re:password-protecting index.php 4 years, 5 months ago #104

  • Partic
  • OFFLINE
  • Moderator
  • Posts: 341
  • Karma: 21
I've always just made the demo site in a sub-directory and moved it later (all you need to do is shift the files then edit MOS_Live_Site, and potentially do a find and replace in MySQL to update any static file references.)

But thought I'd give what you were trying a go.

First round I got to work, but it was for the whole directory, which is what the basic htaccess htpasswd routine is designed for.

So more googling ensued, and this page explains it nicely enough

www.elated.com/articles/password-protect...pages-with-htaccess/

So add something similar to this to your .htaccess file:

AuthUserFile /home/kpsystems/jtcentral/.htpasswd
AuthType Basic
AuthName \"Test Site Access\"

Files \"*.php\"
Require valid-user
/Files

And then have your .htpasswd file in the right place and you should be able to secure the Joomla CMS from displaying, but they can still access the old site.
Patrick Jackson
www.kpsystems.com.au
Ask Anything Joomla and I'll helpfully tell you where to go

Re: Zeus and htacesss 4 years, 5 months ago #118

  • dex
  • OFFLINE
  • Moderator
  • Posts: 779
  • Karma: 12
Oops! I have finally discovered that they are running Zeus not Apache, so many things are gone a bit astray. It has also been fun getting SEF URLs working. For anyone who wonders, the answer is here:
forum.joomla.org/index.php/topic,31242.0.html
Dex Randall
Joomla! web design and production
Sydney JUG organiser + joomla.org.au site admin
www.spikesystems.com.au
www.twitter.com/dexx

Re:password-protecting index.php 3 years, 1 month ago #1330

  • jengregory
  • OFFLINE
  • Senior Boarder
  • Posts: 61
  • Karma: 2
For those that have Zeus I have a quick question. I have recently built a site in Zeus which took some time to get organised but finally it worked. My problem now is I can't make a copy of the site to use on my MAMP localhost server because some of the core files have been changed so that it works with Zeus, not Apache.

Does anyone have experience in using a test site for Zeus and do you just amend the core files back and forth each time you download to your test site and then upload to the live site?
Jennifer Gregory
www.standoutwebdesign.com.au

Re: SEO Friendly URLs in 1.5 using Zeus Server 3 years, 1 month ago #1352

  • jengregory
  • OFFLINE
  • Senior Boarder
  • Posts: 61
  • Karma: 2
Just in case someone searches for Zeus information and they find this thread I thought I would add this link to making SEO Friendly URLs work on 1.5 in Zeus.

http://www.netregistry.com.au/support/kb...s.php?questionid=239
Jennifer Gregory
www.standoutwebdesign.com.au
  • Page:
  • 1
Time to create page: 0.44 seconds
You are here: Forum