|
Posted by Rik on 10/27/06 03:25
laredotornado@zipmail.com wrote:
> Hi,
>
> I have verified that mod_rewrite is enabled on my Apache 2.2 instance.
> However, now I'm having a problem just serving pages using .htaccess
> files. Following Rik's advice, my .htaccess file is as follows
>
> RewriteEngine On
>
> RewriteCond %{REQUEST_FILENAME} -f
> RewriteCond %{REQUEST_FILENAME} !^accesscontrol.php
> RewriteRule ^(.*)$ accesscontrol.php?file=$1&%{QUERY_STRING} [NC,L]
>
> Right now, my accesscontrol.php file only contains
>
> <?php
>
> header("HTTP/1.0 200 OK");
>
>>
>
> But when I visit a php or html file in the directory with the
> .htaccess file, I just get a blank browser screen and the page is not
> served. I know the mod_rewrite module is working because I have
> successfully used it. Any suggestions on what I'm doing wrong above?
A blank page may be served. A custom 404 document or indeed the page
requested will still have to be served, and will not automagically appear.
Try to check the header, livehttpheaders for Firfox or Fiddler for MSIE are
invaluable tools.
For instance, with you previous "HTTP/1/0 401 Unauthorised", the headers I
receive are:
HTTP/1.1 401 Unauthorized
Date: Fri, 27 Oct 2006 03:21:08 GMT
Server: Apache/2.2.2 (Win32) DAV/2 mod_ssl/2.2.2 OpenSSL/0.9.8b
mod_autoindex_color PHP/5.1.4
X-Powered-By: PHP/5.1.4
Content-Length: 24
Content-Type: text/html
But indeed, a blank page, because no error document is given.
In your accesscontrol you can either include your custom 401 document, or
serve the file after verification of the user.
--
Rik Wasmus
Navigation:
[Reply to this message]
|