I used the URL trick of the article http://www.phpbuilder.com/columns/tim20000526.php3. In that article, he explains how to force a php script without a .php extension to run using the htaccess file. Then the variables are processed to make the url a more search engine friendly one. Example. Instead of http://www.localhost.com/local.php?country=US&state=AL&city=Birmingham , a url would say http://www.localhost.com/local/US/AL/Birmingham thus making it look like a static page.
Now to do this he explodes the URL to get the variable out. What I want to do is change the separating character from a slash to a dash (-). The reason being, is because of a discussion I had with a SEO company that said that webpages that appear in the root directory or next one up, will have a better chance at high rankings. Any I want my url to look like this instead...
http://www.localhost.com/local-US-AL-Birmingham
That way, it appears to be a root level page. I would also (not essential to take it this far, but would be even better) like to make the Birmingham variable say Birmingham.htm in my MYSQL data table.
http://www.localhost.com/local-US-AL-Birmingham.htm
Any ideas on this, php programmers? I am new to this stuff and I tried to add the - and could not get it to read... Here is what I tried in the file that is named 'local' ... (the '/' works but '-' doesn't so far)...
<?php
$url_array=explode("-",$REQUEST_URI); //BREAK UP THE URL PATH
// was USING '/' as delimiter changed to '-' but no luck
$url_category=$url_array[2]; //Which country?
$url_subcategory=$url_array[3]; //Which state?
$url_product=$url_array[4]; //Which Major City ?
if($url_product) {
include('include/city.inc');
exit;
} elseif ($url_subcategory) {
include('include/state.inc');
exit;
}
elseif ($url_category) {
include('include/country.inc');
exit;
}
else {
Header ( "Location: index.html");
exit;
}
?>