ok things I thought were ok with sitemap are now producing a different problem...
Google is looking for this:
http://thelifephotography.com/cat-show%20me%20the%20money-7.htmleven though my sitemap says this at
www.thelifephotography.com/googlex.php :
http://thelifephotography.com/cat-show_me_the_money-7.htmso I am guessing google and not accept underscore _ as a character in an address. My questin is what to replace the underscore with to make replace a <space> in an address in the special characters?
ANd why is google looking for html files even though my sitemap says to look for htm files?
Ok, I got it working...
with this:
$imgname = strtr($image['image_name'], ", éèêàëâúóíìáàABCDEFGHIJKLMNOPQRSTUVWXYZ","--eeeaeauoiiaaabcdefghijklmnopqrstuvwxyz");
and this for cats
$imgname = strtr($image['image_name'], ", éèêàëâúóíìáàABCDEFGHIJKLMNOPQRSTUVWXYZ","--eeeaeauoiiaaabcdefghijklmnopqrstuvwxyz");
$img_url = $gallery_url.'img-'.$imgname.'-'.$imgid.'.html';
and this
$cat_url = $gallery_url.'cat-'.$catname.'-'.$catid.'.html';
The I replaced <spaces> with - and .htm with html....
But I have just came to a cold hard realization...
Somehow rewrite is not working...
I have placed my .htaccess @
/htdocs/.htaccess
which is the same directory as 4images.
it looks like this
RewriteEngine On
RewriteRule ^sitemap.xml$ googlez.php
#RewriteBase /
RewriteRule ^cat-(.*)-([0-9]+)\.htm$ categories.php?cat_id=$2&%{QUERY_STRING}
RewriteRule ^cat\.htm$ categories.php?%{QUERY_STRING}
#Mod_bmollet : Image name in URL
RewriteRule ^img-(.*)-([0-9]+)\.htm$ details.php?image_id=$2&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.search.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^img([0-9]+)\.lightbox.htm$ details.php?image_id=$1&%{QUERY_STRING}
RewriteRule ^sitemap.xml$ googlez.php
#Mod_bmollet : This is to make search function work ( redirect links from search results )
RewriteRule ^search\.htm$ search.php?%{QUERY_STRING}
RewriteRule ^search\.([0-9]+)\.htm$ search.php?page=$1&%{QUERY_STRING}
RewriteRule ^lightbox\.htm$ lightbox.php?%{QUERY_STRING}
RewriteRule ^lightbox\.([0-9]+)\.htm$ lightbox.php?page=$1&%{QUERY_STRING}
RewriteRule ^sitemap.xml$ googlez.php
I know i did this three times.... Becuse 1 time didnt work.
my googlez.php creates the xml and looks like this:
<?
# Create Google Sitemap for 4images
# Created by Mai Minh (minh@maingo.com http://www.vna2z.com)
# Modified by Oliver van der Werf (info@flash-webdesign.de http://www.flash-webdesign.de)
# Date: 28/11/2006 | 02.01.2007
# You can send ping to Google with this request: http://www.google.com/webmasters/sitemaps/ping?sitemap=URL_TO_YOUR_SITEMAP
#---------------------------------
require("config.php");
$link=mysql_connect("$db_host","$db_user","$db_password");
mysql_select_db("$db_name") or die ("Cannot connect database!");
# 4images top page (with trailing slash)
$gallery_url = 'http://thelifephotography.com/';
# Priotity
//select between 0.0 and 1.0
//0.0 identifies the lowest priority page(s) on your website
//1.0 identifies the highest priority page(s) on your website
$prio_img = 0.5;
$prio_cat = 0.8;
$prio_profile = 0.1;
# Frequency
//"always", "hourly", "daily", "weekly", "monthly", "yearly" or "never"
$freq_img = 'daily';
$freq_cat = 'daily';
$freq_profile = 'daily';
# Use Short URLs
$shortURL = 1; // 0 or 1
# Print XML header
xml_head();
# Print URLs
$categories = mysql_query('SELECT cat_id, cat_name FROM ' . $table_prefix . 'categories');
while ($category = mysql_fetch_array($categories))
{
$catid = $category['cat_id'];
$catname = strtr($category['cat_name'], " éèêàëâúóíìáàABCDEFGHIJKLMNOPQRSTUVWXYZ","_eeeaeauoiiaaabcdefghijklmnopqrstuvwxyz");
if ($shortURL == 1) {
$cat_url = $gallery_url.'cat-'.$catname.'-'.$catid.'.html';
}else {
$cat_url = $gallery_url.'categories.php?cat_id='.$catid;
}
print_xml($cat_url,$prio_cat,$lastmod,$freq_cat);
}
$images = mysql_query('SELECT image_id,image_name,image_active,image_date FROM ' . $table_prefix . 'images');
while ($image = mysql_fetch_array($images))
{
if ($image['image_active'] == 1) {
$imgid = $image['image_id'];
$imgname = strtr($image['image_name'], ", éèêàëâúóíìáàABCDEFGHIJKLMNOPQRSTUVWXYZ","--eeeaeauoiiaaabcdefghijklmnopqrstuvwxyz");
$date = $image['image_date'];
$lastmod = date("Y-m-d",$date)."T".date("H:i:s",$date)."+00:00";
if ($shortURL == 1) {
$img_url = $gallery_url.'img-'.$imgname.'-'.$imgid.'.html';
}else{
$img_url = $gallery_url.'details.php?image_id='.$imgid;
}
print_xml($img_url,$prio_img,$lastmod,$freq_img);
}
}
$profiles = mysql_query('SELECT user_id, user_lastaction FROM ' . $table_prefix . 'users WHERE user_id >= "1"');
while ($profile = mysql_fetch_array($profiles))
{
$profileid = $profile['user_id'];
$date = $profile['user_lastaction'];
$date = date("Y-m-d",$date)."T".date("H:i:s",$date)."+00:00";
$profile_url = $gallery_url.'member.php?action=showprofile&user_id='.$profileid;
print_xml($profile_url,$prio_profile,$date,$freq_profile);
}
# Print XML footer
xml_foot();
function xml_head() {
$freq = 'daily';
$priority = '1.0';
$mod = date("Y-m-d")."T".date("H:i:s")."+00:00";
echo "<?xml version='1.0' encoding='UTF-8'?>
<urlset xmlns=\"http://www.google.com/schemas/sitemap/0.84\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">";
}
#-----------------------------------------------
# xml_foot
#-----------------------------------------------
function xml_foot() {
echo "
</urlset>";
}
#-----------------------------------------------
# print_xml
#-----------------------------------------------
function print_xml($url,$priority,$lastmod,$changefreq) {
$temp = "<url>
<loc>$url</loc>";
$temp .= " <priority>$priority</priority>";
if ($lastmod != '') {
$temp .=" <lastmod>$lastmod</lastmod>";
}
$temp .= " <changefreq>$changefreq</changefreq>
</url>";
echo $temp;
}
?>
Things are getting indexed like this
http://thelifephotography.com/img-the-chinese-lower-class-struggle-for-work-daily-as-global-economic-crises-widens-as-unemployment-increopeases--23.html
which I hope will prevent the %20 stuff...
But the problem is when you go to my site the actual url is still
http://thelifephotography.com/img-these_workers_too_but_on_a_smile_for_the_camera..._people_like_them_who_are_at_the_greatest_immediate_risk_if_you_come_early_all-142.htm
Is there supposed to be some kind of rewrite to reversly convert all addresses to match the characters replaced in the character map?
THanks for any help.
OK!!!!! I found out why!!!
God I dont know why it takes my brain so long to work!!!!
If you are using the Google BEST SEO mod you must edit your sessions.php to make the special characthers match the special characters in your google.php file!!!!!