Results 1 to 5 of 5

Thread: .htaccess Password Generator

  1. #1
    Join Date
    Apr 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default .htaccess Password Generator

    Hi guys,

    Im not sure if my question is okay to post here but I just thought if any of you can help me out would be appreciated!

    I tried to creating a secure page using the website here:
    http://tools.dynamicdrive.com/password/

    I paste my URL at this blank provided: Path to .htpasswd file relative to your server's root directory: (e.g. - /home/site_name/)

    .....but the URL that I use does not seem to work: This is my URL:
    E:\Domains\e\myhomepage.com\user\httdocs\export\

    Can anyone explain to me why it doesn't work here?

    Cheers,
    Ulat

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    I couldn't know for certain, but it's probably not the correct path. If you have PHP, you could get the correct path from $_SERVER['DOCUMENT_ROOT']. Run this code from the directory you want to password-protect:
    PHP Code:
    <?php print $_SERVER['DOCUMENT_ROOT']; ?>

  3. #3
    Join Date
    Jan 2007
    Location
    Davenport, Iowa
    Posts
    2,385
    Thanks
    100
    Thanked 113 Times in 111 Posts

    Default

    Is this file going to be run on your home computer or on a server? I am not an expert in this area, but I imagine there will be a conflict if you upload this to your server where you use forward slashes as opposed to backslashes. The backslash generally has a specific meaning, which is to translate the following character as a literal.

    E:\Domains\e\myhomepage.com\user\httdocs\export\ The highlighted portion should not be present either.
    To choose the lesser of two evils is still to choose evil. My personal site

  4. #4
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    backslashes usually indicate a Windows-based OS. I'm not sure if that carries over to Windows Servers, so I didn't say anything.

    I'm almost positive that the drive letter shouldn't be there, though, unless (?) you're trying to set this up on a local machine (but even so, I don't think so).

    Edit:

    I stand self-corrected: on my desktop (Ubuntu 10.04LTS), the path to my localhost root directory is /opt/lampp/htdocs.

    on my laptop (WinXP Pro), it is C:/xampp/xampp/htdocs.

    note, however, that xampp still uses forward slashes.

    Last edited by traq; 04-21-2011 at 03:45 AM.

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Windows servers use normal URLs. That is: http://......./something/

    But for local paths (very important to keep these ideas separate), they do use backslashes like E:\.....\something\

    So this can be a problem when mixing systems, such as testing locally on a windows machine (using backslashes in your links-- hrefs, srcs) then uploading and assuming it will link properly.

    As far as I know you can use back slashes and the server will automatically correct it for those local paths (so you never need forward slashes). The only exception may be low level system stuff such as the system() or exec() commands in PHP. And of course when actually working directly on the server not through HTTP etc.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •