Some time back I did a successful mod rewrite for my directory powered by the Free PHP Directory Script (www.freephpdirectoryscript.com)

So I just though thats I should  share this with other directory owners.

Now if you want those lovely .html extensions instead of those ugly urls for your pages, read on…

IMPORTANT ~ Please take a backup of all the files that you are editing

Directory Script : Biz Directory Script / Free PHP Directory Script

Add a .htaccess file with the following code

Quote:

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^([0-9]+)\.html$ /index.php?c=$1 [L]

OPEN index.php

FIND

Quote:

$replace = array(”[CATEGORY_NAME]” => $subcategories[$x][”name”], “[CATEGORY_URL]” => $dir.’index.php?c=’.$subcategories[$x][”id”]);

Might need to be replaced in two places

REPLACE WITH

Quote:

$replace = array(”[CATEGORY_NAME]” => $subcategories[$x][”name”], “[CATEGORY_URL]” => $dir.’’.$subcategories[$x][”id”].’.html’);

FIND

Quote:

$category_url = $dir.’index.php?c=’.$parent_categories[$x][”id”];

Might need to be replaced in two places

REPLACE WITH

Quote:

$category_url = $dir.’’.$parent_categories[$x][”id”].’.html’;

OPEN add_url.php

FIND

Quote:

$category_url = $dir.’index.php?c=’.$parent_categories[$x][”id”];

REPLACE WITH

Quote:

$category_url = $dir.’’.$parent_categories[$x][”id”].’.html’;

Sorry cant provide any support….as I had someone else do that for me

Hope that helped..

1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 4.75 out of 5)
Loading ... Loading ...