**From the original thread

Sorry to be a pain but I would love this hack to work but I have obviously done something wrong

the forums come up correctly but I get a 404 error on every page. I have redone the hack from start three times now but the same thing always happens

You can see at www.forums.ic-games.co.uk

Any idea whats up? I have tried to read as much of this thread as I can put its getting on 12 pages and I may have missed something.

Any help appreciated

How would I know that rewrites are activated on the server? Having problems doing this hack yet everyone else has success :p

My last guess is that I cannot do this on our server?

However the "/" error is still not fixed on the instructions and the last code changes feature repeated steps. Could someone clean up the original instructions as its a nightmare in its current form and obviously people (me anyway :p) are still visiting this thread for the first time :(

How would I know that rewrites are activated on the server?

Contact your host and ask them :)

Contact your host and ask them :)

That sounds like a plan, cheers Keith :)

Easy way to check if it's working or not is to upload the phpinfo file. Search the results for mod_rewrite. If it's listed an installed module under the Apache heading then it's there and running, if it doesn't show up then it hasn't been installed.

Does this thread/method supercede the one started by cscgal?

In the multiple pages of replies to the original thread, many amendments / other ideas were discussed. This thread simply implements some of those other ideas, so one doesn't have to read through so many posts.

okay thanks

nice job on the site too

Small issue.

I did everything, ran it, looked fine got error pages. Changed the .htaccess as suggested by another poster - looked great.

One problem remains

One of my forum "headers" and one of my forum "links" shared the same name, so the generated HTML was identical for two different sections.

I went into the admin section and renamed the forum link prt to add an additional word but the html didn't update leaving two links with the same name.

As a result clicking either of these givees a popup saying:

f2-name-of-file is not a registered protocol

How can I fix this? Also does this mean when I add new forums to the site they wont be updated either?

Small issue.

I did everything, ran it, looked fine got error pages. Changed the .htaccess as suggested by another poster - looked great.

One problem remains

One of my forum "headers" and one of my forum "links" shared the same name, so the generated HTML was identical for two different sections.

I went into the admin section and renamed the forum link prt to add an additional word but the html didn't update leaving two links with the same name.

As a result clicking either of these givees a popup saying:

How can I fix this? Also does this mean when I add new forums to the site they wont be updated either?

Actually looking further into it the original file name has a semi colon : in it. I'm wondering if that is causing a problem?

Okay yep that was it. Because I had the : in there it didn't know how to handle that in traditional HTML format. Removing that fixed it. i could also have two forums with the same name because of the inclusion of the f1, f2 etc at the start which in effect makes them unique pages.

Great work cscgal and KeithMcL
Thank you so very much for making this available to us, it works perfectly!

Glad to hear it's working for you :)

This hack is awesome! KeithMcL, cscgal, Ted S, and anyone I missed, thanks!

I applied this hack but am having some small issues I was hoping someone either ran into and knows how to fix, or someone to point me in in the right direction.

I followed Keith's instructions and got almost everything working but the 'Last Post' link.

For an example, check my forums. http://www.baddosage.com/forums/

Basically when I click on a last post I get forwarded by my mod_rewrite but the url ends up going somewhere I don't recognize.

When clicking http://www.baddosage.com/forums/newpostinthread5008.html --redirect--> http://www.baddosage.com/forums/post62504.html#post62504 which ends up being a 404. I am confused as to why this is happening? Any ideas?

I don't see where to edit my post but I had more info to add.

If I go into my .htaccess file and change this line
RewriteRule ^newpostinthread([0-9]+).html$ showthread.php?goto=newpost&t=$1 [L]
too
RewriteRule ^newpostinthread([0-9]+).html$ showthread.php?t=$1 [L]

(basically removing the ?goto=newpost section)

My links will now load the page. Anyone else having issues with their newpostinthread pages working?

Hi, guys I just (tried) to instail this hack and some strange things are happening, have a look at http://www.akamarketing.com/webmaster-forums, I think the reason why the URL are not being found for the forums is because of the backslashes thing, the first slash is easy to put into the replacement text but the second slash not so easy. This is what I have done:

found
<a href=\"forumdisplay.php?$session[sessionurl]f=$forumid\">$forumtitle</a>

and replaced with
<a href=\"f$forumid-" .mod_rewrite_title($forumtitle)\. ".html\">$forumtitle</a>

Where is the second slash meant to go, after the closing right bracket or after the "." or before the ".html", please help on this matter. Also it appears I too have duplicate forum names although only one is an active hyperlink, any resolutions on this?

Hello,

I've done a similar hack to vbulletin myself and I'm having one problem. When viewing a thread that has an SE friendly url, users cannot use the reputation feature. The code for the reputation button opens a new window and needs the $post[postid] value to be passed to a javascript function.

Is there anyway to solve this problem?

Would it make sense to disable the 'vBulletin Archive' since search engine spiders can correctly navigate the forum? Having double data might not be a good idea for the search engines.

Can anyone comment on this?

Hello,

I've just discovered a small problem.

One of my threads spans 4 pages. The little links at the bottom of the thread that you can click to get to individual pages shows up (you know they have "1 2 3 ... Last Page")

So actually two issues.

First, if you click any of the visible numbers it's not rewrite friendly - it's the default VB PHP ocding. That's okay though. However,

Point 2: If you click on the "Last Page" link a 404 page shows up. If you go to page 3 then click the number 4 its fine, but if you are page 1 and don't see the number 4 - in it's place is the "Last Page" link, the error occurs. The reason is instead of going to page 4 it goes to / has the link as:

http://www.domain-name-is-here.com/forum/lastpostinthread[threadid].html

Any idea how to fix that?

anyone providing support for this mod ? it seems the are many un answred questions.
thnaks

One minor addon I'd still like,i've got a category for "tutorials" I want just that section to use tutorial[tid]-<name>-<name> instead of thread[tid]-name-name any ideas?

Also,

Did anyone fix the problem of the nav bar (thread tree) following ted s' style of links instead of just the default.

I am quite a newbie to vB, but this is mod is very sweet,

I rember that I read somewhere it better to use "_" for spaces than spaces itself, but cant find it anymore :-/ can anyone say something to this ?

also the archives are not rewritten, its probablly not needed at, all just would be nice to know

and while I am at the archive issue, may its only a setting I did wrong, my arviches neve shows the links clickable, it this a special mod I need therefor or only a setting

I am getting duplicate forum titles also. How did you resolve this issue?

You can see the results here:www.okctalk.com other than that it seems to be working great.

Cheers!

Got a problem. The rewite works fine, except that I'm seeing duplicate forum names. Any idea what I need to edit to fix this?

www.clantt.com/vb/ is the url in question.

Thanks in advance. Nice work.

I realized a bug, in this thingie, just stupid guys like me may trap into this but just wanted to correct for the guys with less html knowledge:

Step 2 - Template Edits
This step covers all the template edits needed. Within the Forum Home Templates group the following templates all require the modification below.

forumhome_forumbit_level1_nopost
forumhome_forumbit_level1_post
forumhome_forumbit_level2_nopost
forumhome_forumbit_level2_post
forumhome_subforumbit_nopost
forumhome_subforumbit_post

In each of the templates above find:

<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">

And Keith said: replace with: wich is WRONG

<a href="f$forum[forumid]-$forum[url].html">$forum[title]</a>

the correct version of above replacement is:
Find:

<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">

replace:

<a href="f$forum[forumid]-$forum[url].html">

otherwise you got 2 forum titles, in your forum home, and I am sure you will not like to seen this,

except this little bug, great post, thx keith :)

Would it be fairly easy to modify this a bit so that the URL for topics also included the forum title, but make it look like a directory?

Basically, something like this:

http://www.bigblueball.com/forums/t28559_member_of_the_month_-december_2004.html

Would be modified to look like this:

http://www.bigblueball.com/forums/announcements/t28559_member_of_the_month_-december_2004.html

... where announcements is the forum title.

Similarly, why not translate

http://www.bigblueball.com/forums/f120_announcements.html to
http://www.bigblueball.com/forums/f120_announcements/ or
http://www.bigblueball.com/forums/f120_announcements/index.html ?

This mimics the structure of the forum, is logical to visitors AND opens up the possibility of improving SEO (by combining forum title + thread title in the URL).

I found a bug. If the forum name has a ? in it, the resulting URL fails. For example:

http://www.bigblueball.com/forums/f128-what-makes-you-laugh?.html doesn't work.

I'm also getting complaints from my admin that there are too many redirects:

# wget http://www.bigblueball.com/forums/newpostinthread28848.html
  --00:54:48--  http://www.bigblueball.com/forums/newpostinthread28848.html
  		   => `newpostinthread28848.html'
  Resolving www.bigblueball.com... done.
  Connecting to www.bigblueball.com[70.84.84.106]:80... connected.
  HTTP request sent, awaiting response... 302 Found
  Location: http://www.bigblueball.com/forums/showthread.php?t=28848&goto=lastpost [following]
  --00:54:48--  http://www.bigblueball.com/forums/showthread.php?t=28848&goto=lastpost
  		   => `showthread.php?t=28848&goto=lastpost'
  Connecting to www.bigblueball.com[70.84.84.106]:80... connected.
  HTTP request sent, awaiting response... 302 Found
  Location: http://www.bigblueball.com/forums/showthread.php?p=159143#post159143 [following]
  --00:54:48--  http://www.bigblueball.com/forums/showthread.php?p=159143
  		   => `showthread.php?p=159143'
  Connecting to www.bigblueball.com[70.84.84.106]:80... connected.
  HTTP request sent, awaiting response... 200 OK
  Length: 37,924 [text/html]
  
 100%[================================================== ==================>] 37,924	 36.17M/s	ETA 00:00
  
  00:54:48 (36.17 MB/s) - `showthread.php?p=159143' saved [37924/37924]

Is this something to be concerned about?

I fixed the problem with question marks in the forum title. I had to make the following changes:

forumdisplay.php - Added regular expression to strip out special characters

// ################ MOD_REWRITE HACK ######################
 foreach ($parentlist AS $forumID)   
 	{
 		$forumTitle = $forumcache["$forumID"]['title'];
 		$forumURL = strtolower(str_replace(" ", "-",str_replace("/", "-", $forumTitle)));	
 		$forumURL = ereg_replace("[\/!£$%^&*«»,.;:'#@~{}|=+`¬<>?]+", "", $forumURL);
 		$navbits["f$forumID-$forumURL.html"] = $forumTitle;
 	}
 // ################ MOD_REWRITE HACK ######################

includes/functions_forumlist.php - Replace in both sections

// ################ MOD_REWRITE HACK ######################
 $forum['url'] = strtolower(str_replace(" ", "-",str_replace("/", "-", $forum['title'])));
 $forum['url'] = ereg_replace("[\/!£$%^&*«»,.;:'#@~{}|=+`¬<>?]+", "", $forum['url']);
 // ################ MOD_REWRITE HACK ######################

Now, questions marks and other special characters that might be in your forum titles won't mess up your URLs.

can you post a test url ?

cause on the url you given there is still the 404 error
I also heard that":" could cause problems is this with your replacement fixed also ?

I always wanted to ask when I use a new template / style all the stuff hast to be redone, I tried to load the template inherited from my master template with all the changed I made here, the the rewirte does work, but the button / pathes arent correct anymore, can this be fixed within the xml file ?

can you post a test url?

The fix I posted above strips out question marks, so the resulting URL now looks like:

http://www.bigblueball.com/forums/f128-what-makes-you-laugh?.html (no more question mark).

I also heard that":" could cause problems is this with your replacement fixed also?

Yes, it will strip out all of the following characters: \/!£$%^&*«»,.;:'#@~{}|=+`¬<>?

I always wanted to ask when I use a new template / style all the stuff hast to be redone, I tried to load the template inherited from my master template with all the changed I made here, the the rewirte does work, but the button / pathes arent correct anymore, can this be fixed within the xml file ?

What I do is first download a copy of my "production" style, then import that as a new style and modify that. I don't know if that's the best practice or not, but it's worked OK for me.

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.