Download example.php and htaccess-example for testing the script.
The easiest way is just to include the class with require_once or include_once.
Here a little example:
----- example-file.php -----
<?php
require_once 'class.relink.php';
$c_relink = new RELINK(); //Reads the .htaccess from the current workdirectory
echo $c_relink->replaceLink('?page=index');
?>
----- end example-file.php -----
And in your .htaccess-file is the following:
----- .htaccess -----
## to add a different text before every link, use the following (optional)
#set link start http://www.example.org/
## turning on the rewrite-engine
RewriteEngine on
## allow relink-class to read the upcoming rules
#set link auto on
RewriteRule (.+?)\.html ?page=$1
----- end .htaccess -----
See the example-files.
Greetings
|