Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

help mw with htaccess please!


yellow

Recommended Posts

Okie, after some struggle I think I just make a right .htaccess which is like this:

AuthUserFile /home/webspace/httpdocs/.htpasswd
AuthType Basic
AuthName "Secret Place"
<LIMIT GET POST>
require valid-user
</LIMIT>

put it in myPhpAdmin folder

then I put .htpasswd which is like this:

admin:$1$LoSzGDiA$q8GCwCY2A6HAqBA2owpJd/

password is admin, just to test!!!

put it in httpdocs folder

But I couldnt login at all, keep getting the error Authorization Required!!!

Please tell me where did i make it wrong!!!!

 

my link here:

http://www.nhatkhoa.info/phpMyAdmin

(just a test site now)

Link to comment
Share on other sites

Ehhm...you give the absolute path in your .htaccess file (o;

 

AuthUserFile /usr/local/etc/apache2/users

 

 

Use htpasswd for changing passwords...

 

"htpasswd file username"

 

btw: I use "vi" for editing text (o;

 

Using editors with DOS linefeeds is a bad idea for UNIX systems (o;

 

You might want to check out the free "crimson editor" for windows...supports DOS/UNIX linefeeds and has built-in ftp client and also syntax highlighting!!

Link to comment
Share on other sites

yup. i know i have to give the abosolute path, buth since this is not my host and i'm setting up the site for my friend, i'm not really sure that the path is correct and i cant contact him now! Is there any code to display the path or something like that?

Link to comment
Share on other sites

I finally fixed it, oh my god!

I create a php file

<?

echo "PHP test<pre>";

$MY_AUTH = $_SERVER{'HTTP_MYAUTH'}

print $MY_AUTH;

echo base64_decode( substr($MY_AUTH,6));

?>

upload onto my server the run it, and i found down the real path wich is like this:

/usr/local/pem/vhosts/16791/webspace/httpdocs/

 

So it's done, i fixed the path in htaccess and it work like a charm!

 

Thanks you guys so much for helping me!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...