Sitemap

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Post Reply
macmukka

Sitemap

Post by macmukka »

I am looking to create a sitemap to submit to Google.

It looks like there was once a mod to do this. (Cant find a download)

http://www.phpwcms.de/forum/viewtopic.p ... sc&start=0

Do I still need a mod to do this or is it built in to phpwcms now?

I use 1.2.8.

Thanks - mac
User avatar
Oliver Georgi
Site Admin
Posts: 9890
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

check sitemap.php - it's included by default - no hack neccessary.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
macmukka

Post by macmukka »

thanks Oliver I'll check in to it!
sandro
Posts: 3
Joined: Tue 6. Jan 2009, 14:56

Re: Sitemap

Post by sandro »

Hi,

The Links inside the Sitemap are not correctly rewritten (Newest PHPWCMS Release and URL rewrite activated and working on the html pages:
<url>

<loc>http://myproject.com/index.php?Die-Kano ... fsatz</loc>
<lastmod>2008-12-29</lastmod>
</url>
it should be:
<url>

<loc>http://myyproject.com/kanon_aufsatz.phtml</loc>
<lastmod>2008-12-29</lastmod>
</url>
How can i change that? Or is something wrong configured?

Best Regards
Sandro
User avatar
juergen
Moderator
Posts: 4556
Joined: Mon 10. Jan 2005, 18:10
Location: Weinheim
Contact:

Re: Sitemap

Post by juergen »

Hey Sandro

Total normal Behavior:

1.) Have the alias, with perhaps 3,4,5 ore more articles
2.) beyond this, the articles themselves.

Why changing ? Perhaps try to leave the alias blank.

and concerning the rewritten links: Did you change the var in config for rewrite from 0 to 1 ?

The same: http://ukw-tagung.com/sitemap.phtml , rewritten, and 283
sandro
Posts: 3
Joined: Tue 6. Jan 2009, 14:56

Re: Sitemap

Post by sandro »

Hi,

Thanks for replying

The part i don't like is the "index.php?" and missing *.phtml in the sitemap.
I want google to index exactly the urls my visitors see, otherwise i risk a duplicate content penalty. (Thats what they do if you have the same content under more than one url...)

Or do i get something wrong?
And of course, every alias is used only once.
User avatar
juergen
Moderator
Posts: 4556
Joined: Mon 10. Jan 2005, 18:10
Location: Weinheim
Contact:

Re: Sitemap

Post by juergen »

hmm, ok then please check in :

../config/phpwcms/conf.inc.php:

Code: Select all

$phpwcms['rewrite_url']=1;
after this, the system will do what you expect ... I hope :D
sandro
Posts: 3
Joined: Tue 6. Jan 2009, 14:56

Re: Sitemap

Post by sandro »

The Rewriting on the Page is working well, the setting is already =1

Its only inside the Google XML Sitemap (/sitemap.php) where the rewriting is not working.
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: Sitemap

Post by flip-flop »

It can´t work, the rewrite to alias.phtml is a htaccess funktion via apache.

Patch for sitemap.php: (But only if you are using a standard .htaccess and rewrite to alias.phtml)

Insert between:
Begin:
require_once (PHPWCMS_ROOT.'/include/inc_front/front.func.inc.php');
Insert:

Code: Select all

// enhanced by k.Heermann (flip-flop) for rewriting to alias.phtml
// --------------------------------------------------------------- +kh 09/01/06
$my_rewrite = false;
if ($phpwcms['rewrite_url'] >= 1  AND  file_exists('.htaccess')) { $my_rewrite = true; }
// ----------------------------------------------------------------
End:
// start XML
echo '<?xml version="1.0" encoding="utf-8"?>'.LF;

Substitute:

Code: Select all

 		$_link = PHPWCMS_URL.'index.php?'.setGetArticleAid( $data );
with:

Code: Select all

		// ---------------------------------------- +kh 09/01/06
		if ($my_rewrite) { $_link = PHPWCMS_URL.setGetArticleAid( $data ).'.phtml'; }
		else { $_link = PHPWCMS_URL.'index.php?'.setGetArticleAid( $data ); }
		// ---------------------------------------- 
  
Knut
Last edited by flip-flop on Wed 7. Jan 2009, 10:19, edited 2 times in total.
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
User avatar
juergen
Moderator
Posts: 4556
Joined: Mon 10. Jan 2005, 18:10
Location: Weinheim
Contact:

Re: Sitemap

Post by juergen »

ups, ok, this was my fault, I thought you where talking about the sitemap CP :oops:
larissa
Posts: 39
Joined: Tue 31. Jul 2007, 23:18
Contact:

Re: Sitemap

Post by larissa »

Hi All
this is my site http://www.myflorenceguide.com/

can you please help me whit this:

if i rename _htaccess to .htaccess and apply to it suggested changes
i get a server error did it happen to you as well ?
Internal Server Error
and moreover what's excatly the right content of .htaccess and do i have to change something also in the category alias to have .phtml ?
in other words teach me step by step
many thanks
larissa
1000 Years to PHPWCMS!
larissa
Posts: 39
Joined: Tue 31. Jul 2007, 23:18
Contact:

Re: Sitemap

Post by larissa »

Sorry I just realize I should have posted here
http://forum.phpwcms.org/viewtopic.php? ... te#p112334
but however i solve it
by commenting
# php_flag magic_quotes_gpc Off
# php_flag register_globals Off
is that ok?
larissa
1000 Years to PHPWCMS!
Post Reply