HomePHP Page 2 - Building a Relational Content Management System in PHP/MySQL
The Rewrite - PHP
You may be familiar with relational databases, but what is a relational content management system? Read on to learn how to build this system, which helps you create a search engine friendly site fairly quickly.
The mod_rewrite for this script is pretty simple. We basically pass everything to the script to decode.
Create a file called ".htaccess": RewriteEngine on RewriteRule ^(.*).html$ index.php?seoname=$1&mode=view [QSA,L]
This will make the files all look like a .html file.
Okay, we need to set up a config.php file to hold the config info.
Create a file called "config.php": <? $sitename = "";// site name $siteurl = "";// site url $aduser = "";// admin username $adpass = "";// admin password $dbhost = "";// database hostname $dbuser = "";// database username $dbpassword = "";// database password $dbname = "";// database name ?>
These settings are important and should be set before we start. The variables are broken down as follows:
$sitename=The name of your website $siteurl=The URL to the affiliate script as it is installed on your site $aduser=Your management login username $adpass=Your management login password $dbhost=Your database host (usually localhost) $dbuser=Your database username $dbpassword=Your database password $dbname=The name of your database