PHP Classes
Icontem

File: DOC


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Benjamin Falk  >  Relink  >  DOC  
File: DOC
Role: Documentation
Content type: text/plain
Description: A short documentation
Class: Relink
Rewrite URLs based on mod_rewrite configuration
 

Contents

Class file image Download
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

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products