Seite 1 von 1

SEO für die Profillinks

Verfasst: 23.06.2006 11:15
von PhoenixDH
Ich setzte das SEO optimierte Board von http://www.seo-phpbb.org/ ein.
Mich würde jetzt interessieren, ob es auch Code für das mod_rewrite der Userprofile gibt, denn das ist dort nicht implementiert!

Quasi: http://www.XXXXXX.XXX/u-234-test.html

Dank euch!

Verfasst: 24.06.2006 10:57
von ATARI
Hätt ich auch Interessse dran.

Verfasst: 29.06.2006 08:19
von PhoenixDH
Hab mich mal an der Kategorie und an den Usern versucht, das Ergebnis:

Habe mich mal an den Kategoriuen versucht, scheint zu klappen:

Code: Alles auswählen

	//
	// Kategorien
	//
	if( strstr ($url, 'index.php?c=') ) {
		$prg=str_replace("index.php?","",$url);
		parse_str($prg, $prg_output);
		$sql = "SELECT cat_title
		FROM " . CATEGORIES_TABLE . "
		WHERE cat_id = '".$prg_output['c']."'";
		if ( !($result = $db->sql_query($sql)) ) {
		message_die(GENERAL_ERROR, 'Could not obtain category information', '', __LINE__, __FILE__, $sql);
		}
		if ( $row = $db->sql_fetchrow($result) ){
			
				$url = str_replace( 'index.php', '', $url );
				$url1 .= strtr($url,array("?c="=>"-c"));
				$url = urlencode(strtolower(str_replace($url_search, $url_replace, $row['cat_title'])));
				$url .= $url1. ".html";
		}
	}
Einfach in der sessions.php vor

Code: Alles auswählen

	//
	// Forum
	//
einfügen! und .htacces Regel erstellen, die hab ich grad net greifbar!

Verbesserungen erwünscht!

Die User wollen net so klappen:

Code: Alles auswählen

	//
	// User
	//
	if( strstr ($url, 'profile.php?mode=viewprofile&u=') ) {
		$prg=str_replace("profile.php?mode=viewprofile&","",$url);
		parse_str($prg, $prg_output);
		$sql = "SELECT username
		FROM " . USERS_TABLE . "
		WHERE user_id = '".$prg_output['u']."'";
		if ( !($result = $db->sql_query($sql)) ) {
		message_die(GENERAL_ERROR, 'Could not obtain user information', '', __LINE__, __FILE__, $sql);
		}
		if ( $row = $db->sql_fetchrow($result) ){
			
				$url = str_replace( 'profile.php?mode=viewprofile', '', $url );
				$url1 .= strtr($url,array("&u="=>"-u"));
				$url = urlencode(strtolower(str_replace($url_search, $url_replace, $row['username'])));
				$url .= $url1. ".html";
		}
	}
Änderungen analog zu seo.phpbb.org - Board!