I was going over some of my old stuff that worked so wonderfully back in php4 and now I just can’t seem to find my bug it may be obvious to someone else.
So what use to happen is you go to website.com/Product/Category_of_product/1.html and I would use php to parse the url and using Mysql indexing get VERY fast loading pages of dynamic content based on how accurate my url was. So the 1.html could be parsed as item number 1 in my database and if we were in a category I could do a search of all products in that category etc. My new problem is not really the php but getting my server to treat the file “Product” as php so that can parse the url like i used to.
What I used to do was modifiy the .htaccess file as such.
[code]php_value error_reporting 7
php_flag display_errors On
RewriteEngine on
Options +FollowSymlinks
<Files “Product”>
ForceType application/x-httpd-php5
<Files “Shared”>
ForceType application/x-httpd-php5
<Files “Catalog”>
ForceType application/x-httpd-php5
[/code]
So The first portion of my old file is as such ( I have in the course of researching this found much better and cleaner ways I intend to implent the parseing of the url but 8 years ago this was golden and it worked for me.)
[php]$expl = explode("/", SELF);
$id = (!empty($_REQUEST[‘str’])) ? $_REQUEST[‘str’] : null;
if(!isset($id))
{
$id = $expl[count($expl)-1];
}
$who = $SERVER[‘SERVER_NAME’];
$id = str_replace ("%20", " “, $id);
$content_title = strtoupper($id);
$id = str_replace (” “, “+”, $id);
$id = str_replace (”", “+”, $id);
$id = str_replace ("-", “+”, $id);
$id = str_replace (".html", “”, $id);
$str = $id;
$main = str_replace("+", " ", $str);
$main = strtoupper($main);[/php]
At some point I will have to create a script that defines the URL parsing array directly to Database fields so if the url is 5 long or 3 directories long I can be more or less specific in my database searches (The data base has millions of entries and its production so this why its necessary to be conservative in our access of the database.
Using Php 5.3.18 and latest apache 2.2 but the old server was php 4.** and apache 2.0.
So hopefully this little bug jumps out at someone else because I can’t read another forum post on these long drawn out php scripts for “friendly urls” when I know we used to do this way before anyone else and with minimal effort.
I just need apache to see Products as PHP and execute the following symlinks.