From:             edwardzyang at thewritingpot dot com
Operating system: 
PHP version:      Irrelevant
PHP Bug Type:     Livedocs problem
Bug description:  Livedocs htaccess is broken

Description:
------------
Livedocs's htaccess file works in a very strange way, by rewriting to a
non-existent file, letting Apache's error document forward it to index.php,
and then handling it. This is confusing, and doesn't work in certain cases
(in said cases, the user consistently gets the File protocols and wrappers
page). A better htaccess file:

Index: .htaccess.in
===================================================================
RCS file: /repository/livedocs/.htaccess.in,v
retrieving revision 1.3
diff -u -r1.3 .htaccess.in
--- .htaccess.in        4 Oct 2004 06:41:13 -0000       1.3
+++ .htaccess.in        2 Apr 2007 21:16:59 -0000
@@ -1,6 +1,6 @@
 RewriteEngine on
-RewriteRule @[EMAIL PROTECTED] @[EMAIL PROTECTED]
-ErrorDocument 404 @[EMAIL PROTECTED]
+RewriteCond %{REQUEST_FILENAME} !-f [OR]
+RewriteCond %{QUERY_STRING} purge=1
+RewriteRule ^([A-Za-z_]+)/([A-Za-z._-]+)\.html$
@[EMAIL PROTECTED]&q=$2 [L,QSA]
 DirectoryIndex index.php
 php_value default_charset "UTF-8"
 AddCharset UTF-8 .html

In this case, we specifically match the HTML file, and directly refer to
the index.php script, instantiating the correct l and q parameters. A user
can also pass ?purge=1 to the HTML file to force it to be regenerated, and
the system intelligently detects when the file does not exist using the -f
command.


-- 
Edit bug report at http://bugs.php.net/?id=40983&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40983&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40983&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40983&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40983&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40983&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40983&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40983&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40983&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40983&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40983&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40983&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40983&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40983&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40983&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40983&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40983&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40983&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40983&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40983&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40983&r=mysqlcfg

Reply via email to