SEO URL TOOLS - The Simple way to get pretty URL's on your PHP site

What are SEO URL TOOLS?

Try Demo

Features:

- does not require complex setting of url rewriting rules on Apache, all settings and URL rewriting handling is done within PHP

- it can provide pretty url support even if http server does not have url rewriting turned on

- you may switch from query url's to pretty url's and back by changing just one configuration parameter

- it is easy to integrate in any site, if you follow the simple rules

- SEO url format is flexible enough to support needs for almost any kind of site

- you may enter custom keywords in url parameters, for example, you may include title of a document in current language

- it may force correct URL-s to your documents. If user comes to site using improper URL, script will force correct one by redirection. Redirection is done with error code 303 so even Google will obey that.

- single url for single document rule is enforced in any way.

- it supports parameters passed as virtual URL path, path options and queries.

- user may customize number of parameters and parameter names by calling few functions within his own code.

- all parameter values are very easily accessible and set within custom application.

 

This script is listed on HotScripts. If you use it and like it, write a review please.

This is an quite simple PHP class that fulfills most of the Search Engine Optimization URL needs. Programmer may easily include this library and start developing site that fully supports pretty url's. He may even customize the way how url's are handled. All he has to do is to learn few simple rules on handling and manipulating URL's.

When you use SEO URL TOOLS you do not create links in documents on your own. You define contents of the URL and then let this library to create actual url. Means to define URL's are simple and straightforward, and what is more important, it is uniform way to create any URL on your site. If you follow this principle, all URL's on your site will follow the same syntax rules and site would provide to you everything you need to know which document to load and what parameters are sent to that document.

SEO URL TOOLS library is free for noncommercial use.

How to install?

Place class_seo_url.php into root folder of the site.

Then you have to turn on and set rewrite engine for your site. Make sure that Apache has rewrite engine module installed and place simple .htaccess file in the very root of your site. Contents of the file is:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L,QSA]

That would instruct Apache to rewrite all URL's to index.php in root of the site. The simplest index.php could be like this:

<pre>
<?php
include ('../class_seo_url.php');
$seo = new seo_url_tools();

$m_url = $seo->get_current_url();
echo "Current url as string: $m_url\n";

$m_url_array = $seo->get_current_url('array');
echo "Current url as array: \n";
print_r ($m_url_array);
echo "\n";

?>
</pre>

It will show you parsed URL's accepted through rewrite engine. It does not use SEO url's yet, but it is fine to check if rewrite engine works. Play with it. Type in various addresses in your browser and watch how they are parsed as parameters. Type addresses with various number of directories in path, type in query parameters and see what you get.

Now, lets turn SEO URL's on. Alter this script by adding one new line to turn SEO mode on (changed line is colored in red):

<pre>
<?php
include ('../class_seo_url.php');
$seo = new seo_url_tools();

$seo->set_pretty_url_mode (true);

$m_url = $seo->get_current_url();
echo "Current url as string: $m_url\n";

$m_url_array = $seo->get_current_url('array');
echo "Current url as array: \n";
print_r ($m_url_array);
echo "\n";

?>
</pre>

Repeat entering various addresses and see how url's are interpreted now.


Built on DevCMS 0.1.4 and SEO URL Tools 1.0.38 - ©2007 Copyright by Predrag Supurović, ©2007 Copyright by DataVoyage