Join us at IRC!
I'd prefer to die standing, than to live on my knees - Che Guevara
Friday, May 25, 2012
Navigation
Members Online
Total Online: 26
Web Spiders: 12
Guests Online: 25
Members Online: 1

Registered Members: 70208
Newest Member: andresuran
Latest Articles
View Thread

HellBound Hackers | Computer General | Webmasters Lounge

Author

php / htaccess problem.

Mr_Cheese
HBH Owner



Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
God
Posted on 29-01-07 22:19
This is the weirdest problem i've encountered and not sure on how to fix it.

spent hours today trying to fix this dam problem will still no success. i reakon i've got about 2 hours tommorow in which it HAS to be sorted.

so please help me out!

Specs:
OS: Windows XP Pro
Program: EasyPHP (latest version)
Server: Apache, running PHP 5
Database: MySQL and PEAR.
CMS: OS-Commerce (open source)

Background:
Heavily tweaked version of OS-Commerce, running MySQL and added PEAR database configuration too. Has custom htaccess throughout the site, to parse html urls into php scblockedripts for processing and output, using Apache ReWrite function. SSL isnt installed and all SSL connections reverted to HTTP instead.

Problem:
the /admin/ panel is htprotceted (obvioulsy). I've configured the htaccess and htpasswd file to how it should be.

When accessing the admin folder im prompted with a login box, as i should be. i enter the correct details and it wont accept anything as a correct answer. i've changed passes, changed htpassed etc and still wont accept correct answers.

So i decided to ditch htaccess and make directory openly accessable, seeing as im only developing on a localhost.

now here is the weird bit. once i've removed the htaccess so theres no prompt or need to login, it acts weird.

i get the whole configuration.php dumped in plaintext in the web pages source, and then after than im left with a big paragraph of chinese charachters.

wtf?

1. Why is this happening? I've never seen this before.
2. How can i fix it?

Tried and Tested solutions:
debugging php scblockedripts. (all seems fine, no errors)
editing config details.
changing htpasswd paths.
FTPing files over to localhost from live site again (incase its happening due to corrupt files)

- considering all the other htaccess files work fine, i cant seem to work out why its happening with just this folder. could it possibly be due to compatibility issues with php4 scblockedripts on php5 server? possibly a server httpd.conf setting i need to chance? php.ini setting i need to change?

im completely lost. google hasnt been any help at all, and even some top coders that i work with dont know why its happening.

any help appreciated.




Author

RE: php / htaccess problem.

Mr_Cheese
HBH Owner



Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
God
Posted on 29-01-07 23:02
ok, now im thinking its possibly the 'Content-Type' has been for some reason been changed to something else.

and the chinese characters are actually the scblockedript doing what it should.(minus plaintext php). so maybe if i set the 'Content-Type' so a version of ascii then it will display as html?

i dont have access to the files at the moment so im thinking off the top of my head.

Would this be the answer? setting the 'Content-Type'?


Author

RE: php / htaccess problem.

skarecrow
Member

Posts: 194
Location:
Joined: 15.12.04
Rank:
God
Posted on 29-01-07 23:46
I really have no clue, I know you asked me via MSN Messenger but I thought I would post up in here.

If it is a charecter encoding that is causing it to display chinese charecters then I belive you can simply change this to going to View -> Charecter Encoding.

If you cannot figure anything out this way, and if possible...

Can you give me the .htaccess file and if possible the source of the file that is displaying plaintext and chinese charecters?

Just one of them things that I have no clue about just sitting here, but if I see the problem I am sure I could probally fix it.

* I just woke up so im sure my spelling / grammer is extra fucked :) *


Please do not contact me asking me for challenge and/or hacking help... I will not reply.
Author

RE: php / htaccess problem.

TrueHacker
Member



Posts: 92
Location:
Joined: 17.08.06
Rank:
God
Posted on 29-01-07 23:47
well im not sure about the 'Content Type'

but if you still want that htaccess to work heres wats wrong..

if the prompt is showing, but not accepting passwords, you're not pointing to the htpasswd file correctly. this took me forever to figure out as well.

Edited by TrueHacker on 29-01-07 23:55
KawasakiMike9@aol.com http://www.black-zero.com
Author

RE: php / htaccess problem.

skarecrow
Member

Posts: 194
Location:
Joined: 15.12.04
Rank:
God
Posted on 29-01-07 23:50
Not necesarily the wrong htpasswd file but really just the wrong path to the file. From my experience that I remember I had always had problems with my .htaccess file with auth... Are you setting the full path to the .htpasswd?


Please do not contact me asking me for challenge and/or hacking help... I will not reply.
Author

RE: php / htaccess problem.

WhiteAcid
Member



Posts: 123
Location: UK
Joined: 08.05.05
Rank:
Elite
Posted on 30-01-07 01:00
It's not Content-Type, that's just how your browser interprets what Apache sends it, not how the PHP gets parsed.

If you have Zend studio it's possible to step through the scblockedript one line at a time, that would help see where the bug comes from.

Can't suggest anything else really.


-Sid
sakaru@gmail.com http://www.whiteacid.org
Author

RE: php / htaccess problem.

SySTeM
-=[TheOutlaw]=-

Posts: 1524
Location: England, UK
Joined: 27.07.05
Rank:
The Overlord
Posted on 30-01-07 08:01
htaccessing with a htpasswd file has never worked with me, I can get htaccess to work, e.g turning dir listing off with it and crap like that, but if I try and use htpasswd, it just breaks...think it's just a Windows problem, because mastergamer also gets this problem.




http://www.elites0ft.com/
Author

RE: php / htaccess problem.

AldarHawk
The Manager



Posts: 1663
Location: Canada
Joined: 26.01.06
Rank:
God
Posted on 30-01-07 12:31
Sounds to me like what SkareCrow suggested. Make sure the relative path to the htaccess file is in your ht directory file.

you can have multiple HTACCESS files but you have to point to EACH one in the base directory.


I(don't)See Just ask Yahoo!Taboo! http://www.erikwestlake.com
Author

RE: php / htaccess problem.

Mr_Cheese
HBH Owner



Posts: 2468
Location: Brighton, UK
Joined: 30.11.04
Rank:
God
Posted on 30-01-07 18:32
fixed the problem.

it was a bad FTP transfer that made a few files corrupt, and having to manually edit the meta 'content-type' to the correct ASCII value.

so there we have it.

anyone else with a similar problem. thats how to solve it.


Guest
Username

Password

Remember Me


Bookmark This Page
Affiliates
Adverts

 

 

Links
By using, viewing or obtaining any information contained on this site, you agree to the disclaimer.

© HellBound Hackers 2008- 2009. Since 3rd December 2004.