A Solution and A Question

Firstly, i would like to Thank CSGAL for this great tutorial. But there are somethings that looks bad to me. That wrong thing is "View Full Version :" Links in Arhcive pages.

For example, in arhive pages you are redirecting to "forumdisplay.php?f=123" instead of thread123.html.

And

"forumdisplay.php?f=1" instead of "keyword.html".

i've solved the forumdisplay.php issue, here is the solution:

archive/index.php:

find:

echo print_archive_navigation($foruminfo, $threadinfo);

	echo "<p class=\"largefont\">$vbphrase[view_full_version] : <a href=\"$vboptions[bburl]/showthread.php?t=$threadinfo[threadid]\">$threadinfo[title]</a></p>\n<hr />\n";

and replace with

echo print_archive_navigation($foruminfo, $threadinfo);

	echo "<p class=\"largefont\">$vbphrase[view_full_version] : <a href=\"$vboptions[bburl]/thread$thread$threadinfo[threadid].html\">$threadinfo[title]</a></p>\n<hr />\n";

That will prevent duplicate pages which may crucial for SEO. And Your "View Full Version :" links will be "thread123.html".


BUT

i couldnt solve the "forumdisplay.php?f=1" instead of "keyword.html" issue. How may i fix that problem, i just added // to :

echo print_archive_navigation($foruminfo);

	echo "<p class=\"largefont\">$vbphrase[view_full_version] : <a href=\"$vboptions[bburl]/forumdisplay.php?f=$foruminfo[forumid]\">$foruminfo[title]</a></p>\n<hr />\n";

i hope somebody help and everything work GREAT with this tutorial.

I JUST did this today


Hope that makes sense, i dont have copies of the original archive page handy to reference for the "find X, replace with X" instructions.

To see in action, check it here: www.tfw2005.com/boards/archive/

EDIT: Code wasnt showing up properly, check attached TXT file for instructions.

Worx XXXing G R E A T now. Thank You for your help. Now the tutorial is irreproachable! ;)

OK - CMPS integration: I'll give instructions based on latesttopics.php module.

But before I do, I'd like to request that people wanting modifications or additions to this hack should PLEASE make their requests HERE IN THIS THREAD, and not bug contributors via other methods. Additionally, NO ONE has my permissions to demand anything from me via any method: If I have time to contribute further to this discussion, I will do so, but I will not in future be intimidated or accept emails from people demanding that I post anything anywhere. Capiche Marcus?

I'm going to assume you have a function implemented to perform the forum/thread title parsing to create a url-friendly name format (as I recommended a while back).

In latesttopics.php, FIND:

while ($thread = $DB_site->fetch_array($threads))
	{
		if (strlen($thread['title']) > $vba_options['portal_threads_maxchars'] AND $vba_options['portal_threads_maxchars'])

Replace with:

while ($thread = $DB_site->fetch_array($threads))
	{
		$thread['url'] = mod_rewrite_title($thread['title']);
		$thread['furl'] = mod_rewrite_title($thread['forumtitle']);

		if (strlen($thread['title']) > $vba_options['portal_threads_maxchars'] AND $vba_options['portal_threads_maxchars'])

Then edit the tempalte adv_portal_latesttopicbits, FIND:

<b><a href="$vboptions[bburl]/showthread.php?t=$thread[threadid]" title="$thread[preview]">$thread[title]</a></b>

Replace with:

<b><a href="$vboptions[bburl]/t$thread[threadid]-$thread[url].html" title="$thread[preview]">$thread[title]</a></b>

Then FIND:

<span class="smallfont"><strong><a href="$vboptions[bburl]/showthread.php?t=$thread[threadid]" title="<if condition="$thread[preview]">$thread[preview]

</if>$vbphrase[by] $thread[postusername] <if condition="$vba_options['portal_threads_showdate']">$thread[postdate] $thread[posttime]</if>">$thread[title]</a></strong></span>

Replace with:

<span class="smallfont"><strong><a href="$vboptions[bburl]/t$thread[threadid]-$thread[url].html" title="<if condition="$thread[preview]">$thread[preview]</if>$vbphrase[by] $thread[postusername] <if condition="$vba_options['portal_threads_showdate']">$thread[postdate] $thread[posttime]</if>">$thread[title]</a></strong></span>

Then FIND:

<div class="smallfont"><a href="$vboptions[bburl]/forumdisplay.php?$session[sessionurl]f=$thread[forumid]">$thread[forumtitle]</a></div>

Replace with:

<div class="smallfont"><a href="$vboptions[bburl]/f$thread[forumid]-$thread[furl].html">$thread[forumtitle]</a></div>

You can make the similar alterations to modules currentpoll.php and news.php as well, to integrate this functionality to your vBA CMPS portal.

NOTE: this element of the guide is based on the use of the function mod_rewrite_title(): if you have not this implemented, go back and do this first.

Hi,

First of all thank you for making this wonderful hack, it works great, I went for basic version and will consider enhancement suggest by all of you. In short a wonderful hack.

Now is the problem I am facing. I am using sub-forums, and even I named the link forms in .htaccess file but still it is not working from forum home page and it shoing a html file name as .html no name but if I go into forum and try to go to sub form from there, it do let me access sub forum from there.

No issue is that I have over 300 sub categories/forums/sub-forums, most are hidden, and access to those are through sub forum link provided on forum home page.

Is there any way I can solve this issue, that when user click on a link forum from forum home it translate to correct address and take user to the forum instead of showing error 404 page ?

Many thanks in advance.

Regards,
Basit

How would you put in place a 301 redirect for all threads in a site? The reason I ask is because google still has the old showthread.php pages.

I've also noticed that as long as the url looks like http://www.domain.com/forum/t123- whatever you have after the dash will redirect to the thread. For example:

http://www.domain.com/forum/t123-whatever.html is the same as http://www.domain.com/forum/t123-whatever-123456789.html

That may not seem like a big deal to some, but what does become a big deal is that if you have a thread you've started, then change the title of the thread, you've essentially created a new web page in google's eyes. This could result in what appears to be duplicate content because google will always be able to get to any page you've made as long as the threadid is the same, meaning t123 prefixes the dash.

Yes, [L] is much better than [R] for SEO reasons. By using [R], the user is actually physically redirected to the php? URL. I don't enable style changes, and have never ran into any problems with any other forum feature.

The use of [L] and [R] are completely different things. I suggest reading the mod_rewrite documentation to understand what each of the flags means. Search the docs for the string '[flags]' without the quotes, and you'll the details of each specific flag, with plenty of examples to use to help you understand them further.

That being said, [R] is the ONLY way to properly redirect the user (which is why the flag exists). I'd stick to the standards more than I'd violate them to boost SEO revenue (and yes, I know a LOT about all of this).

Hello Natch
Sry 4 my english... can you tell me how 2 install l this html Hack in the News Modul of vBadvanced CMPS v1.0.1? Thank you !!!

OK - CMPS integration: I'll give instructions based on latesttopics.php module.

But before I do, I'd like to request that people wanting modifications or additions to this hack should PLEASE make their requests HERE IN THIS THREAD, and not bug contributors via other methods. Additionally, NO ONE has my permissions to demand anything from me via any method: If I have time to contribute further to this discussion, I will do so, but I will not in future be intimidated or accept emails from people demanding that I post anything anywhere. Capiche Marcus?

I'm going to assume you have a function implemented to perform the forum/thread title parsing to create a url-friendly name format (as I recommended a while back).

In latesttopics.php, FIND:

while ($thread = $DB_site->fetch_array($threads))
	{
		if (strlen($thread['title']) > $vba_options['portal_threads_maxchars'] AND $vba_options['portal_threads_maxchars'])

Replace with:

while ($thread = $DB_site->fetch_array($threads))
	{
		$thread['url'] = mod_rewrite_title($thread['title']);
		$thread['furl'] = mod_rewrite_title($thread['forumtitle']);

		if (strlen($thread['title']) > $vba_options['portal_threads_maxchars'] AND $vba_options['portal_threads_maxchars'])

Then edit the tempalte adv_portal_latesttopicbits, FIND:

<b><a href="$vboptions[bburl]/showthread.php?t=$thread[threadid]" title="$thread[preview]">$thread[title]</a></b>

Replace with:

<b><a href="$vboptions[bburl]/t$thread[threadid]-$thread[url].html" title="$thread[preview]">$thread[title]</a></b>

Then FIND:

<span class="smallfont"><strong><a href="$vboptions[bburl]/showthread.php?t=$thread[threadid]" title="<if condition="$thread[preview]">$thread[preview]

</if>$vbphrase[by] $thread[postusername] <if condition="$vba_options['portal_threads_showdate']">$thread[postdate] $thread[posttime]</if>">$thread[title]</a></strong></span>

Replace with:

<span class="smallfont"><strong><a href="$vboptions[bburl]/t$thread[threadid]-$thread[url].html" title="<if condition="$thread[preview]">$thread[preview]</if>$vbphrase[by] $thread[postusername] <if condition="$vba_options['portal_threads_showdate']">$thread[postdate] $thread[posttime]</if>">$thread[title]</a></strong></span>

Then FIND:

<div class="smallfont"><a href="$vboptions[bburl]/forumdisplay.php?$session[sessionurl]f=$thread[forumid]">$thread[forumtitle]</a></div>

Replace with:

<div class="smallfont"><a href="$vboptions[bburl]/f$thread[forumid]-$thread[furl].html">$thread[forumtitle]</a></div>

You can make the similar alterations to modules currentpoll.php and news.php as well, to integrate this functionality to your vBA CMPS portal.

NOTE: this element of the guide is based on the use of the function mod_rewrite_title(): if you have not this implemented, go back and do this first.

*bump* here are the 2 Templates. I hope you can help me.
adv_portal_news_archive

<!-- News Archive -->

<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<tr>
<td class="tcat" <if condition="$mods == 1"> colspan="5"</if>>$vba_options[portal_blockbullet] <span class="smallfont"><strong>$vbphrase[news_archive]</strong></span></td>
</tr>
<if condition="$mods == 1">
<tr>
<if condition="$vba_options">
<td class="thead" width="15">&nbsp;</td>
</if>
<td class="thead" width="100%"><span class="smallfont">$vbphrase[title_username_date]</span></td><td class="thead" width="15"><span class="smallfont">$vbphrase[replies]</span></td><td class="thead" width="15"><span class="smallfont">$vbphrase[views]</span></td>
</tr>
</if>
$newsarchivebits

</table>
<br />

<!-- End News Archive -->

& the adv_portal_news_archivebits

<if condition="$mods == 1">
<tr>
<if condition="$vba_options">
<td class="alt2"><if condition="$show"><img alt="" border="0" src="$news[threadiconpath]" title="$news[threadicontitle]" /></if>
</td>
</if>

<td class="alt1" align="$stylevar">
<if condition="$news">
<span style="float:$stylevar"><img alt="" class="inlineimg" src="$stylevar[imgdir_misc]/subscribed.gif" title="$vbphrase[you_are_subscribed_to_this_thread]" /></span>
</if>
<b><a href="$vboptions[bburl]/showthread.php?t=$news[threadid]" title="$news[preview]">$news[title]</a></b>

<div class="smallfont"><phrase 1="$vboptions[bburl]/member.php?$session[sessionurl]u=$news[postuserid]" 2="$news[postusername]">$vbphrase[by_x]</phrase>
<if condition="$news">
<span style="float:$stylevar"><img alt="" src="$stylevar[imgdir_rating]/rating_$news[rating].gif" title="<phrase 1="$news[votenum]" 2="$news[voteavg]">$vbphrase[thread_rating_x_votes_y_average]</phrase>" /></span>
</if>
</div>

<div class="smallfont">$news[postdate] <span class="time">$news[posttime]</span></div>

</td>

<td align="center" class="alt2"><span class="smallfont">$news[replycount]</span></td>
<td align="center" class="alt1"><span class="smallfont">$news[views]</span></td>
</tr>

<else />
<tr>
<td class="$getbgrow">
<if condition="$news[threadiconpath]">
<img alt="" src="$news[threadiconpath]" border="0" title="$news[threadicontitle]" />
</if>
<if condition="$news">
<img alt="" class="inlineimg" src="$stylevar[imgdir_misc]/subscribed.gif" title="$vbphrase[you_are_subscribed_to_this_thread]" />
</if>
<span class="smallfont"><b><a href="$vboptions[bburl]/showthread.php?t=$news[threadid]" title="<if condition="$news[preview]">$news[preview]

</if>$vbphrase[by] $news[postusername] $news[postdate] $news[posttime]">$news[title]</a></b></span>
<div class="smallfont">$vbphrase[last_post_by] <a href="$vboptions[bburl]/member.php?find=lastposter&amp;t=$news[threadid]">$news[lastposter]</a></div>
<div class="smallfont">$news[lastpostdate] <span class="time">$news[lastposttime]</span></div>
<div class="smallfont">$news[replycount] $vbphrase[replies], $news[views] $vbphrase[views]</div></td>
</tr>

</if>

& the News.php

<?php
// ++=========================================================================++
// || vBadvanced CMPS v1.0.1
// || © 2003-2004 vBadvanced.com & PlurPlanet, LLC - All Rights Reserved
// || This file may not be redistributed in whole or significant part.
// || http://vbadvanced.com
// || Downloaded 02:50, Thu Feb 3rd 2005 - 4204
// || 
// ++ ========================================================================++

foreach ($modules AS $omods)
{
	if ($omods['identifier'] == 'news' AND in_array($omods['modid'], explode(',', $pages['modules'])))
	{
		$shownews = true;
		$newsid = $omods['modid'];
	}
	if ($omods['identifier'] == 'newsarchive' AND in_array($omods['modid'], explode(',', $pages['modules'])))
	{
		$showarchive = true;
		$archiveid = $omods['modid'];
		$mods['modcol'] = $omods['modcol'];
		$mods[$archiveid]['displayorder'] = $omods['displayorder'];
	}
}

unset($omods);

if ($vba_options['portal_news_forumid'])
{
	if ($vba_options['portal_news_maxposts'])
	{
		if ($vba_options['portal_news_maxposts'] AND $vba_options['portal_news_enablearchive'])
		{
			$limit = $vba_options['portal_news_maxposts'] + $vba_options['portal_news_enablearchive'];
		}
		else
		{
			$limit = $vba_options['portal_news_maxposts'];
		}
		$newslimit = 'LIMIT ' . $limit;
	}

	$foruminfo['allowratings'] = $vba_options['portal_news_showrating'];

	$counter = 0;

	$getnews = $DB_site->query("
			SELECT " . iif($vba_options['portal_news_showrating'], 'IF(votenum >= ' . $vboptions['showvotes'] . ', votenum, 0) AS votenum, IF(votenum >= ' . $vboptions['showvotes'] . ' AND votenum != 0, votetotal / votenum, 0) AS voteavg,') . "
			thread.threadid, thread.title, replycount, postusername, postuserid, thread.dateline AS postdateline, thread.lastposter, thread.lastpost, IF(views<=replycount, replycount+1, views) AS views, forumid, post.postid, pagetext, allowsmilie
			" . iif ($vba_options['portal_news_showsignature'], ', showsignature, usertextfield.signature') . "
  		" . iif ($vba_options['portal_news_showicon'] , ',thread.iconid AS threadiconid, iconpath AS threadiconpath') . " 
  		" . iif ($vba_options['portal_news_showavatar'] , ', avatarpath, NOT ISNULL(avatardata) AS hascustom, customavatar.dateline AS avatardateline, avatarrevision') . " 
  		" . iif ($vba_options['portal_news_showsubscribed'] AND $bbuserinfo['userid'] , ', NOT ISNULL(subscribethread.subscribethreadid) AS subscribed ') . " 
  		" . iif ($vba_options['portal_news_showattachments'], ', attachment.filename, attachment.filesize, attachment.visible, attachmentid, counter, thumbnail, LENGTH(thumbnail) AS thumbnailsize') . "
			FROM " . TABLE_PREFIX . "thread AS thread
			LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = thread.firstpostid) 
  		" . iif ($vba_options['portal_news_showicon'] , 'LEFT JOIN ' . TABLE_PREFIX . 'icon USING (iconid)') . " 
  		" . iif ($vba_options['portal_news_showattachments'] , 'LEFT JOIN ' . TABLE_PREFIX . 'attachment AS attachment ON (post.postid = attachment.postid)') . " 
			" . iif ($vba_options['portal_news_showavatar'] OR $vba_options['portal_news_showsignature'], 
				'LEFT JOIN ' . TABLE_PREFIX . 'user AS user ON (user.userid = post.userid)
			') . "
			" . iif ($vba_options['portal_news_showsignature'], 'LEFT JOIN ' . TABLE_PREFIX . 'usertextfield AS usertextfield ON (post.userid = usertextfield.userid)') . "
  		" . iif ($vba_options['portal_news_showavatar'] , '
				LEFT JOIN ' . TABLE_PREFIX . 'avatar as avatar ON (avatar.avatarid = user.avatarid)
				LEFT JOIN ' . TABLE_PREFIX . 'customavatar as customavatar ON (customavatar.userid = user.userid)
			') . " 
  		" . iif ($vba_options['portal_news_showsubscribed'] AND $bbuserinfo['userid'] , ' LEFT JOIN ' . TABLE_PREFIX . 'subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = \'' . $bbuserinfo['userid'] . '\')') . " 
			$deljoin
			WHERE forumid IN($vba_options[portal_news_forumid]) AND thread.visible = 1 AND thread.open != 10 $notdeleted
			GROUP BY post.postid
			ORDER BY " . iif($vboptions['stickynewsthreads'], 'sticky DESC,') . " postdateline DESC
			$newslimit");
	while ($news = $DB_site->fetch_array($getnews))
	{
		$counter++;

		if ($vba_options['portal_news_archivepreview'])
		{
			$news['preview'] = $news['pagetext'];
		}

		$dateposted = vbdate($vba_options['portal_news_dateformat'], $news['postdateline']);
		$news = process_thread_array($news, '', $vba_options['portal_news_showicon']);

		if ($counter <= $vba_options['portal_news_maxposts'] AND $shownews)
		{
			// Signature
			$show['signature'] = false;
			if ($vba_options['portal_news_showsignature'] AND $news['showsignature'])
			{
				$news['signature'] = parse_bbcode($news['signature'], 'nonforum', $vboptions['allowsmilies']);
				$show['signature'] = true;
			}

			// News Avatar
			$newsavatarurl = '';
			if ($vba_options['portal_news_showavatar']) 
			{
				if ($news['avatarpath']) 
				{
					$newsavatarurl = $vboptions['bburl'] . '/' . $news['avatarpath'];
				}
				else if ($news['hascustom']) 
				{
					if ($vboptions['usefileavatar'])
					{
						$newsavatarurl = $vboptions['bburl'] . '/' . $vboptions['avatarurl'] . '/avatar' . $news['postuserid']. '_' . $news['avatarrevision'] . '.gif';
					}
					else
					{
						$newsavatarurl = $vboptions['bburl'] . '/image.php?' . $session['sessionurl'] . 'u=' . $news['postuserid'] . '&amp;dateline=' . $news['avatardateline'];
					}
				}
			}

			// News Message
	
			$allowsmilie = '';
			if ($vba_options['portal_news_enablesmilies'] AND $news['allowsmilie'])
			{
				$allowsmilie = 1;
			}

			$news['message'] = parse_bbcode2($news['pagetext'], $vba_options['portal_news_enablehtml'], $vba_options['portal_news_enablevbimage'], $allowsmilie, $vba_options['portal_news_enablevbcode']);
	
			if ($vba_options['portal_news_maxchars'] AND strlen($news['message']) > $vba_options['portal_news_maxchars'])
			{
				$news['message'] = fetch_trimmed_title($news['message'], $vba_options['portal_news_maxchars']) . construct_phrase($vbphrase['read_more'], $vboptions['bburl'], $news['threadid'], $session['sessionurl']);
			}
			
			// News Attachments
			$attachment = '';
			if ($news['attachmentid'])
			{
				$newsforumperms = fetch_permissions($news['forumid']);
				if ($news['thumbnail'] AND $vboptions['attachthumbs'] AND ($newsforumperms & CANGETATTACHMENT))
				{
					$attachment = '<a href="' . $vboptions['bburl'] . '/attachment.php?' . $session['sessionurl'] . 'attachmentid=' . $news['attachmentid'] . '" target="_blank"><img border="0" src="' . $vboptions['bburl'] . '/attachment.php?' . $session['sessionurl'] . 'attachmentid=' . $news['attachmentid'] . '&amp;stc=1&amp;thumb=1" /></a>';			
				}
				else
				{
					$attachment['attachmentextension'] = file_extension($news['filename']);
					$attachment['filename'] = $news['filename'];
					$attachment['attachmentid'] = $news['attachmentid'];
					$attachment['filesize'] = vb_number_format($news['filesize'], 1, true);
					$attachment['counter'] = $news['counter'];
					eval('$attachment = "' . fetch_template('postbit_attachment') . '";');
					$attachment = str_replace('"attachment.php', '"' . $vboptions['bburl'] . '/attachment.php', $attachment);
				}	
			}

			eval('$home[$newsid][\'content\'] .= "' . fetch_template('adv_portal_newsbits') . '";');
		}
		else
		{
			eval('$newsarchivebits .= "' . fetch_template('adv_portal_news_archivebits') . '";');
		}
	}				

	if ($showarchive AND $newsarchivebits)
	{
		eval('$home[$archiveid][\'content\'] = "' . fetch_template('adv_portal_news_archive') . '";');
	}

	$DB_site->free_result($getnews);
	unset($news, $foruminfo['allowratings'], $newsarchivebits, $attachment, $counter, $newsforumbits);
}

?>

Hello,

I currently have a problem. I manage to install the modification but it seems that when I try to select a forum link it takes me back to my main page ( I think its an error that redirects me to the main page) It looks like the pages are being renamed to an html page but its not taking me to the appropriate page. Any ideas? Here is a copy of my .htaccess file.


Regards,

Valentine

RewriteEngine on
Options +FollowSymLinks
RewriteRule ^thread([0-9]+).html$ showthread.php?t=$1 [L]
RewriteRule ^lastpostinthread([0-9]+).html$ showthread.php?goto=lastpost&t=$1 [L]
RewriteRule ^newpostinthread([0-9]+).html$ showthread.php?goto=newpost&t=$1 [L]
RewriteRule ^forum([0-9]+).html$ forumdisplay.php?f=$1 [L]
RewriteRule ^post([0-9]+).html$ showthread.php?p=$1 [L]

Great hack, haven't installed it yet because I'm still weighing the benefit of having clean links against the gargantuan task of maintenancing this hack with every VB update.

Any suggestions?

The use of [L] and [R] are completely different things. I suggest reading the mod_rewrite documentation to understand what each of the flags means. Search the docs for the string '[flags]' without the quotes, and you'll the details of each specific flag, with plenty of examples to use to help you understand them further.

That being said, [R] is the ONLY way to properly redirect the user (which is why the flag exists). I'd stick to the standards more than I'd violate them to boost SEO revenue (and yes, I know a LOT about all of this).

After reading the documentation, I concur that L and R do mean different things. But I don't understand why [L] would be better for SEO. In fact, according to the Apache documentation referenced, it might be more appropriate to use both flags together.

(I hope the forum isn´t counting me out again - tried to post this a few minutes ago and the forum just logged me out and the post was gone :mad:..to hell..;) )


Hi there,

this mod_rewrite modification is truely awesome and I wanna thank those who shared their knowledge to the community.
First I gotta say - sorry for my english, I´m from germany and my english is a little bit frozen. Don´t have to use it here very often ;)

I´m running several vb3.03´s on a shared server, seperated through subdomains (All running in different subfolders and different db´s). So far as I can see I have a problem with the .htaccess-file because after uploading the modified one I´m encountering ugly error 500´s.

The server itself tells me in phpinfo that the mod_rewrite module is loaded - which means to me that the apache supports this function.

I tried to search this thread for others with the same problem - but it seems that I´m the only one. (Dani, have you already noticed that the "Search this thread"-function isn´t working correct ? It comes up with results for the entire site instead of showing results for the specific thread where you started the search.)

Therefore I´m running the boards in subfolders I uploaded one .htaccess-file in each and every board-root (modified for the specific board). Another .htaccess exists in the server-root which is pointing to the errordocuments 403, 404 and 500.

Could it be that I have to deal with rewrite_base url´s when using subforums ? At the moment my .htacces looks like this:

RewriteEngine on
   Options +FollowSymLinks
   RewriteRule ^thread([0-9]+).html$ showthread.php?t=$1 [L]
   RewriteRule ^lastpostinthread([0-9]+).html$ showthread.php?goto=lastpost&t=$1 [L]
   RewriteRule ^newpostinthread([0-9]+).html$ showthread.php?goto=newpost&t=$1 [L]
   RewriteRule ^forum([0-9]+).html$ forumdisplay.php?f=$1 [L]
   RewriteRule ^info-support.html$ forumdisplay.php?f=2 [L]
   (...)

Could anyone help me to get this thing up and running ? I just don´t see & understand what I could have done wrong..:o

Any help appreciated.

Regards,
Marv.

Are you using mod_alias? If so you should use the [PT] flag with mod rewrite rules.

Are you using mod_alias? If so you should use the [PT] flag with mod rewrite rules.

Hi DanceInstructor,

so far as I can see mod_alias is listed as a loaded module on the server - the same way mod_rewrite is. Does this mean that I have to use the [PT] flags ? (Even if I don´t have a glue what they are used for..)

If so - could you do me a favor and show me an example how I should fix the .htaccess-file?

Regards & TIA,
Marv.

So far, so good. Seems that my problem discribed in the post above is solved. The reason for the error 500´s was a disabled AllowOverride (NONE) in the httpd.cfg, so we changed that to ALL. That did the trick.

By now I´m struggeling with another problem some mentioned before. The odd "domain.com/.html"-problem with subforums.
It took me some time today to read through all 13 pages of this thread, but as far as I understood - with my limited english-skills - few had the problem but nobody a solution to it. Am I wrong ?

It´s the same problem as described here http://www.daniweb.com/techtalkforums/showpost.php?p=48534&postcount=34 but unfortunality his solution and Dani´s suggestion didn´t seem to work for me.

May be I´m just snowblind :rolleyes:. Could someone have a look in my functions_forumlist.php if I made a mistake in there?

Now, that I´ve almost spent the whole weekend in front of my computer, had uncountable talks with other vb3-fellows it seems that I can´t solve this and I´m about to give up. Even when everything else is fine - except the forumhome with all the dead /.html links.

At this point I get mad at myself that I can´t see whats going wrong here.. :mad: Or in other words: I´m really desperate and looking for help :-|

So please.. anyone ?

Sorry for the confusing posts - after checking all files line by line I found a "/" which doesn´t belong there.

What little signs can do...^^

Hi All

Thanks Dani for an excellent mod, I just have a few questions I hope someone can answer before I go ahead and isntall the mod.

Not sure if this is the case already, but I wondered if it is possible to make the mod only affect 'guests' (ie non logged in users such as search engine bots). The reason I ask is because I guess limiting it just to guests would be easier on server load(?) and won't mess around with any session ids that vB may be utilising?.

I'd appreciate your thoughts.

And thanks for writing a great article.

Hi,

I installed Dani's first post to the T. I am having the sub-forum problem. All subforums resolve in an error page.

Did someone find a fix to this?

Marvin, where was that /?

Hi guys, have been following this thread here...really like the idea of this mod and would like to give it a shot on my forums.

Just to let everyone know, Keith was generous enough to have rewritten this tutorial combining my hack as well as Ted's.

http://www.daniweb.com/tutorials/12725.html

appears the URL is broken!

Hi guys, have been following this thread here...really like the idea of this mod and would like to give it a shot on my forums.

appears the URL is broken!

You could see the instructions + bug fixes in this thread http://www.daniweb.com/techtalkforums/thread12725.html

That's the revised tutorial and it's different than Dani's. I looked and didn't see any fix to subforum issues.

Awsome tutorial, thanks for sharing.

I have two questions:

1. What about these "1 2 3 > Last" links that points to subsequent threads/pages? is there a way to change them to use standard URL?

2. Thread title in URL in archive, is this possible?

Thanks,
-k

My hat off to you, Dani! Installed without any problem! :lol:

Thanks a lot!

-k

You're referring to the new 3.0.7 one, right?

You're referring to the new 3.0.7 one, right?

Yep. First I installed it on a test server, then exported style to xml and imported it to my real website, and voila!

-k

Hi, I found a problem, why my apache didnot work mod_rewrite module, I have installed it, it is my httpd.conf files

#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule status_module modules/mod_status.so
#LoadModule unique_id_module modules/mod_unique_id.so
LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule ssl_module modules/mod_ssl.so
######Load Php Module###########

Alias /vbb "C:/Apache_Group/Apache2/cgi-bin/vbb/"

<Directory "C:/Apache_Group/Apache2/cgi-bin/vbb/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>


.htaccess files

RewriteEngine on
Options +FollowSymLinks
RewriteRule ^thread([0-9]+).html$ showthread.php?t=$1 [L]
RewriteRule ^lastpostinthread([0-9]+).html$ showthread.php?goto=lastpost&t=$1 [L]
RewriteRule ^post([0-9]+).html$ showthread.php?goto=newpost&t=$1 [L]
RewriteRule ^forum([0-9]+).html$ forumdisplay.php?f=$1 [L]


The second question is:

My website is chinese font, if I use

<a href="$forum.html"><strong>$forum[title]</strong></a>

in my vbb template, it shows bad code, like this:

http://localhost/hoopchina/vbb/鲳国嗪.html

How to resolve this problems? $forum.html

should I use <a href="forum$forum[forumid].html"> ?

Hullo I'm new here and must say that I'm very impressed with this mod_rewwrite.

However, I have been looking at the most updated version and am a trying to incorporate this but am confussed by the following.

I have noted this:- Below are the PHP files that need to be edited. You will notice two lines at a time. The first line represents what to search for, and the second line represents what to replace it with.

So without further ado ...

$highlightwords = '&amp;highlight=' . urlencode(implode(' ', $display['highlight']));
$highlightwords = '-' . urlencode(implode(' ', $display['highlight']));

$display['forums']["$key"] = "<a href=\"forumdisplay.php?$session[sessionurl]f=$forumid\"><b><u>" . $forumcache["$forumid"]['title'] . '</u></b></a>';
$display['forums']["$key"] = "<a href=\"forum$forumid.html\"><b><u>" . $forumcache["$forumid"]['title'] . '</u></b></a>';

showthread.php

$highlightwords = iif($goto, '&', '&amp;') . 'highlight=' . urlencode($_GET['highlight']);
$highlightwords = '-' . urlencode($_GET['highlight']);

exec_header_redirect("showthread.php?$session[sessionurl_js]p=$getlastpost[postid]$highlightwords#post$getlastpost[postid]");
exec_header_redirect("threadedpost$getlastpost[postid]$highlightwords.html#post$getlastpost[postid]");

In the above I do not know if I should delete 1 line and add several.

Jezella

Please ask all questions related to the new tutorial in the new tutorial thread. This tutorial is entirely different. However, each paragraph has two lines - replace the first line with the second.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.