WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How do I make a link private or password protective (6 posts)

  1. bckpkrs
    Member
    Posted 8 years ago #

    I would like to have a link within a publically accessible post that is password protected. I'd either like to have a text link to a large image, or a thumbnail link to a large image that is available so that special subscribers can enter a password download full screen verisons of the photo.

    Can anyone tell me how to do this?

    I haven't been able to find anything within the WP Support archive.

  2. Mark (podz)
    Support Maven
    Posted 8 years ago #

    Put the picture inside another directory.
    Protect that directory using .htaccess / .htpasswd
    Link as normal

    When clicked, a popup will appear asking for the user/pass
    That do ?
    http://www.clockwatchers.com/htaccess_tool.html

  3. bckpkrs
    Member
    Posted 8 years ago #

    Podz:

    Thanks for that fast answer. was hoping it was easy like that;

    I've installed the htaccess file that was generated by WP when turning on my permalink structure. But I've never manually tweaked that file before.

    The site you links for me returned code:

    AuthUserFile /home/user/.htpasswd
    AuthGroupFile /dev/null
    AuthName "Private Area"
    AuthType Basic
    <Limit GET POST>
    require valid-user
    </Limit>

    Is there a particular place or way to paste this into the htaccess file? I assume I need to change something in that first line, right?

    Cheers,

  4. Ajay
    Member
    Posted 8 years ago #

    Just paste it after the code generated by WP.

  5. Mark (podz)
    Support Maven
    Posted 8 years ago #

    AuthUserFile /home/user/.htpasswd

    Yup - that path (not url!) does need changing.
    http://www.tamba2.org.uk/files/abs.zip
    Download and unzip that (it's 1kb)

    Upload it to the directory in which the image will go
    Visit that script in your browser
    A path will be displayed - that's what you need for the first line (along with the .htpasswd on the end)

  6. bckpkrs
    Member
    Posted 8 years ago #

    Perrfect. Thanks, guys.

    This one's resolved.

    Any chance ya wanna take a crack at my other unanswered post about the extra space above the header pic on 'inside' pages? :)

    Cheers & thanks again for the help.

Topic Closed

This topic has been closed to new replies.

About this Topic