This is an old revision of the document!


Sitemap-XML (Google)

Forum: http://forum.phpwcms.org/viewtopic.php?p=112317#p112317

Rewriting sitemap output with /sitemap.php for sitemap.xml file. (index.php?alias → /alias.phtml)

Normaly 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:

// 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;


and

Substitute:

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

with:

		// ---------------------------------------- +kh 09/01/06
		if ($my_rewrite) { $_link = PHPWCMS_URL.setGetArticleAid( $data ).'.phtml'; }
		else { $_link = PHPWCMS_URL.'index.php?'.setGetArticleAid( $data ); }
		// ---------------------------------------- 
 
english/other-enhancements/sitemap-xml.1240639525.txt.gz · Last modified: 2018/06/03 18:08 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0