View Full Version : .htaccess Password Generator
siabanie
04-20-2011, 03:41 PM
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
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 print $_SERVER['DOCUMENT_ROOT']; ?>
james438
04-21-2011, 03:26 AM
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.
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).
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.
djr33
04-21-2011, 04:39 AM
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.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.