hide page alias from default page url in google sitemap generator

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
balle
New Member
New Member
Posts: 8
Joined: Fri May 11, 2007 12:10 pm

hide page alias from default page url in google sitemap generator

Post by balle »

I noticed that the default url with priority 1 is www.domain.com/home instead of just www.domain.com
so i  managed to make the defauld url www.domain.com

replace in gsitemap.php

Code: Select all

echo ' <loc>' . $onecontent->GetURL() . '</loc>'. "\n";
with

Code: Select all

 if ($onecontent->GetURL() == $onecontent->DefaultContent()) {
		echo ' <loc>' . $gCms->config['root_url'] . '/</loc>'. "\n";}
		else {echo ' <loc>' . $onecontent->GetURL() . '</loc>'. "\n";}
Last edited by balle on Fri May 11, 2007 2:30 pm, edited 1 time in total.
KO
Power Poster
Power Poster
Posts: 562
Joined: Mon Nov 06, 2006 7:55 pm

Re: hide page alias from default page url in google sitemap generator

Post by KO »

Good idea!
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: hide page alias from default page url in google sitemap generator

Post by tsw »

this is changed in GetUrl in svn and should affect everywhere.

1.1 will have use root_url for default content everywhere.
Post Reply

Return to “Tips and Tricks”