Gogul
Gogul

Reputation: 298

TYPO3 password protect a single Page

I have a scenario in which I need to password protect a single page in typo3. No front-end user required Just a password protection is enough.

Regards, Gogul

Upvotes: 1

Views: 1268

Answers (2)

Georg Ringer
Georg Ringer

Reputation: 7939

There are several problems regarding the solution by using a .htaccess. It will fail at least in the following cases:

  • Call the page with the alternative url index.php?id=<pageid>
  • If an editor changes the page title, the URL will change as well and you loose the protection.

Using felogin is really simple as it is a core extension and you don't need any registration. Further advantages are:

  • It is secure. Passwords are transferred using RSA protection if you don't yet use https
  • You can add a login box on the same page and hide it if someobody logs in
  • Any editor can create users and change passwords

Upvotes: 3

maxhb
maxhb

Reputation: 8865

Unfortunately this kind of feature is not part of typo3 core system.

Easiest way is probably using a .htaccess file to password protect a single page.

Example configuration:

<FilesMatch "secret-area.html">
  AuthName "The text the user sees when login in"
  AuthType Basic
  AuthUserFile /file/to/htaccess/.htpasswd
  require valid-user
</FilesMatch>

The actual user information is stored in the above mentioned file .htpasswd. To create a vaild .htpasswd file you can use a online generator like http://www.htaccesstools.com/htpasswd-generator/

For a detailed explanationb have a look at http://support.hostgator.com/articles/cpanel/how-to-password-protect-one-file

Another possibility is using the extension password but it's quite old and probably needs to be adopted to be used with a current TYPO3 version: https://typo3.org/extensions/repository/view/password

Upvotes: 2

Related Questions