Apache Server configuration support - .htaccess set, but error when access some pdf files

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > September 2007 > .htaccess set, but error when access some pdf files





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author .htaccess set, but error when access some pdf files
zhangpingfan@yahoo.com

2007-09-12, 1:21 pm

I configured my apache server to restrict the access of a group of pdf
files via my cgi program only.

The SetEnvIf is like follows:

SetEnvIf Referer "^http://www.myserver.com/myprog.cgi" local_referal
<Directory /files/pdfs>
Order Deny,Allow
Deny from all
Allow from env=local_referal
</Directory>

When I access the pdf files, some of them could not be displayed.
But a retry later maybe success. i.e. the error is not repeatable.

The apache log files shows:

When error occurs, there are two requests for the same file, but in
the second, referrer is NULL.

10.1.1.1 - - [12/Sep/2007:10:35:15 +0900] "GET /myprog.cgi?
target=BC&caseNo=NSP061056 HTTP/1.1" 200 2348 "http://www.myserver.com/
index.htm" "Mozilla/4.0 (compatible; MSI
E 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 2.0.50727; .NET CLR
1.1.4322)"
10.1.1.1 - - [12/Sep/2007:10:35:15 +0900] "GET /files/nsp061056.pdf
HTTP/1.1" 200 1179648 "http://www.myserver.com/myprog.cgi?
target=BC&caseNo=NSP061056" "Mozilla/4.0 (compatible; MSIE 6.0; Window
s NT 5.1; SV1; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)"
10.1.1.1 - - [12/Sep/2007:10:35:15 +0900] "GET /files/nsp061056.pdf
HTTP/1.1" 403 1762 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.1; SV1; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)"

In a normal situation, only one request appears.

10.1.1.1 - - [12/Sep/2007:10:37:15 +0900] "GET /myprog.cgi?
target=BC&caseNo=NSP061044 HTTP/1.1" 200 2348 "http://www.myserver.com/
index.htm" "Mozilla/4.0 (compatible; MSI
E 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 2.0.50727; .NET CLR
1.1.4322)"
10.1.1.1 - - [12/Sep/2007:10:37:15 +0900] "GET /files/nsp061044.pdf
HTTP/1.1" 200 1179648 "http://www.myserver.com/myprog.cgi?
target=BC&caseNo=NSP061044" "Mozilla/4.0 (compatible; MSIE 6.0; Window
s NT 5.1; SV1; InfoPath.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)"

The browser is IE6.

Could someone please shed some light on it?
Thanks in advance.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com