Re: Dynamic directory structures

From: CountScubula (me_at_scantek.hotmail.com)
Date: 12/30/03


Date: Tue, 30 Dec 2003 09:30:30 GMT

Ok, I got a simple set up that works, I just tested it,

in your .htaccess file add this
ErrorDocument 404 /dynpage.php

and the dynpage.php reads as follow
<?php

     $r = $_SERVER['REQUEST_URI'];
     list($n,$page,$sub_category_id) = split($r);
     // note $sub_category_id is already set now, so dont look for it with a
$_GET
     include("$page.php");
?>

You can see a funky example at http://findit.myhq.info/cars/trucks

--
Mike Bradley
http://gzen.myhq.info  -- free online php tools


Relevant Pages

  • Rewrite rule security question
    ... I have a script that generates the htaccess file and I ... session for generating and setting session cookie. ... ErrorDocument 403 /index.php?error403 ... Is this a secure way of doing this? ...
    (Security-Basics)
  • Re: issue with htaccess and getenv(REQUEST_URI)-please help
    ... into my .htaccess file, it screws up the value returned by: ... filename such as index.php ... Everything is fine when I don't have ErrorDocument 404 /404.php in the ...
    (alt.php)
  • Re: issue with htaccess and getenv(REQUEST_URI)-please help
    ... into my .htaccess file, it screws up the value returned by: ... filename such as index.php ... Everything is fine when I don't have ErrorDocument 404 /404.php in the ...
    (alt.php)
  • Re: FCGI app reloading on every request
    ... Tried putting this in the .htaccess file: ... ErrorDocument 403 "File type not supported." ... It's an Apache configuration problem. ...
    (comp.lang.python)
  • Re: returning a true 404
    ... > My .htaccess file reads: ... > ErrorDocument 400 /404.php ... As long the header() statement is the first thing in your script. ...
    (comp.lang.php)