My PHP "HTTP_ACCEPT" Problem

Got a response from the godaddy tech rep saying he didn't know the answer to my problem and wanted the page where it was occuring. So before I sent him [url=http://www.codedread.com/2.0_Beta/cd_tucked_away/test2.php]this link[/url] to prove that the $_SERVER["HTTP_ACCEPT"] was missing, I decided to test it at the base of my web space [url=http://www.codedread.com/test2.php]here[/url]. Guess what? HTTP_ACCEPT is there in the second link. So I've concluded this must be a .htaccess problem that I've created for myself. Here is the .htaccess file that I've put in my "2.0_Beta" subdirectory: [code:1] Options SymlinksIfOwnerMatch RewriteEngine on ErrorDocument 404 /2.0_Beta/404.html RewriteRule ^.htaccess*$ - [F] # Rewrite to our "hidden" directory and file RewriteRule ^$ cd_tucked_away/index.php RewriteRule ^index\.html /2.0_Beta/ RewriteRule ^index\.htm /2.0_Beta/ [/code:1] I can explain what I thought I was doing, see if you can detect any obvious problem: [code:1] Options SymlinksIfOwnerMatch RewriteEngine on [/code:1] Standard code to turn on the rewrite engine, though I confess I don't know exactly what "SymlinksIfOwnerMatch" does. [code:1] ErrorDocument 404 /2.0_Beta/404.html [/code:1] Change the 404 error document to my own (current file is a placeholder). [code:1] RewriteRule ^.htaccess*$ - [F] [/code:1] Block browsing access to the .htaccess file (though it seems that godaddy prevents this anyway). Now the rewrite rules. This is Rule #1: [code:1] RewriteRule ^$ cd_tucked_away/index.php [/code:1] This says if you get the request for http://www.codedread.com/2.0_Beta/ Apache will rewrite this to a request for cd_tucked_away/index.php. "cd_tucked_away" is a directory inside 2.0_Beta that users shouldn't really know about. It's the mechanism I plan to use so that the fact that I'm using PHP is not accessible to a user. This is Rules #2 and #3: [code:1] RewriteRule ^index\.html /2.0_Beta/ RewriteRule ^index\.htm /2.0_Beta/ [/code:1] Remember that each rewrite rule causes Apache to run through the .htaccess file from the top. Thus, if someone requests http://www.codedread.com/2.0_Beta/index.html or http://www.codedread.com/2.0_Beta/index.htm, then this rule rewrites this to a request for http://www.codedread.com/2.0_Beta/. Thus, when the .htaccess is scanned again, Rule #1 is matched (that rewrites to the cd_tucked_away/index.php. I don't see anything funny there necessarily unless something happens to the request headers along the way...any clue?

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can use BBCode tags in the text.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]".

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor, sorry but we need it to help prevent automated submissions.
ten plus equals 19
Solve this math question and enter the solution with digits. E.g. for "two plus four = ?" enter "6".