954,141 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

I found an error with the hack. If someone uses a : in their thread title it hoses the hack. The browser thinks is is a protocol that they are defining like http or ftp.

1EightT
Newbie Poster
7 posts since Aug 2004
Reputation Points: 10
Solved Threads: 0
 

I'm sorry for not being active in this thread lately. I have been very busy with back to school stuff ;)

To go back and see if I could answer everyone's questions ...

Polo => I don't experience DaniWeb being too slow - it might have been that you accessed it during a very busy time of day, or your computer connection? If others notice it too, I will look into it

aussie, I'm not sure if this is the problem, but the same way you start off your rewritten urls with ^ you should end them with $ ... Unfortunately, I only have experience with phpBB2 and vBulletin3

Nkisberg, I'm actually a bit confused by your question :( Not sure what you're asking.

The .htaccess file will make the clean URLs redirect to the real ones when you load the clean URLs in your web browser. They will not change the way the forum behaves at all, or where links in the forum point to. You change the forum links by editing the vBulletin templates and the php files.

1EightT, what do you mean? I understand what you mean if there is a : in the forum URL, but the thread title is not affected by this hack?

cscgal
The Queen of DaniWeb
Administrator
19,421 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
 

This is what I am saying, or trying to say.

Visit www.nick0r.co.uk (my vb forum)

Click test on towards the right of the page, you'll see it leads to a 404.
I cannot see why it leads to a 404 as i've followed yours and teds instructions perfectly.

Next, click Main forum and then test and you'll see at the top:
Card Game Forums > Main Category > Main Forum

Click either main category or main forum and you'll be taken to a 404.

Both of the above problems I cannot work out how to fix, please advise.

nkisberg2000
Newbie Poster
7 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

Just to say i found a solution to the problem where you get and unknown url with thread(id).html , what i did was..

Open /includes/functions_online.php

Find:
[php]
switch($filename)
[/php]

Above put:

[php]
if (eregi("thread", $filename)) {

$filename = 'showthread.php';

}
[/php]

This ensures that as long as the URL has the word thread in it, it trats it like a thread :cheesy:

YoungCoder
Junior Poster
193 posts since Aug 2004
Reputation Points: 13
Solved Threads: 2
 

Go to this forum on my site http://www.highaltitudeimports.com/f75-trade-zone.html

Click on any thread that has a : in the title like FS: Si Rims

As of page 3 there was a section added to the hack to have keyword rich url's for the threadbit. Works great, but what rewrite rule do we insert to convert the :'s into spaces or something else

1EightT
Newbie Poster
7 posts since Aug 2004
Reputation Points: 10
Solved Threads: 0
 

1EightT

I think a ReWrite condition is required to strip out the : in thread titles.

From looking at the rewrite guide closest match to the practical examples listed would be:

... RewriteEngine On # Either use the (plaintext) allow list from goodsites.txt RewriteMap ProxyAllow txt:/usr/local/apache/conf/goodsites.txt # Or, for faster access, convert it to a DBM database: #RewriteMap ProxyAllow dbm:/usr/local/apache/conf/goodsites # Match lowercased hostnames RewriteMap lowercase int:tolower # Here we go:

# 1) first lowercase the site name and strip off a :port suffix RewriteCond ${lowercase:%{HTTP_HOST}} ^([^:]*).*$ # 2) next look it up in the map file. # "%1" refers to the previous regex. # If the result is "OK", proxy access is granted. RewriteCond ${ProxyAllow:%1|DENY} !^OK$ [NC] # 3) Disallow proxy requests if the site was _not_ tagged "OK": RewriteRule ^proxy: - [F] ...

Some modification is required to make it work though. Got stuck here. ReWrite Guide

Zen
Newbie Poster
2 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

thanks cscgal, unfortunately with the $ it still behaved the same.

aussie
Newbie Poster
6 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 
aussie
Newbie Poster
6 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

Actually there is no need to mess around with mod_rewite to strip out the ":" in thread titles.
Just insert a colon in the code

/?!.$%£()~*@

This will strip out the : in thread urls.forumdisplay.php

[PHP]// added by keith
$thread['url'] = strtolower(str_replace(" ", "-", $thread['threadtitle']));
$thread['url'] = ereg_replace("[/?!.$%£()~*@]+", "", $thread['url']);
// added by keith[/PHP]

aussie: not really sure about your problem.. not sure which mod_rewrite version you are following but stick with one, cscgal or Ted S.

Zen
Newbie Poster
2 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

Zen


this is in relation to attempting rewrite on an xmb forum.

aussie
Newbie Poster
6 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

I wonder if Ted can write full instructions, e.g take the appropriate bits of cscgal's and put them into one set of instructions, I seem to think I've failed somewhere as i've got confused on which instructions to use.

nkisberg2000
Newbie Poster
7 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

As I require this to work, I've now posted this as a paid project at http://www.scriptlance.com/

If, interested, search for:

Mod_rewrite For Htaccess


Thank you.

aussie
Newbie Poster
6 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

Hi cscgal,

first, very nice tutorial - thank you so much.

On DaniWeb, I've only bothered to add rewritten multiple pages to the forum listings and not to the actual threads. This is because it's important for google to spider the multiple forum pages to find links to all of the threads on DaniWeb, but it's not important for people to find the middle of threads through google - I'd rather them get the full benefit and only find the first page - after all, that's the one with the google ad and that's also the one that makes the most sense to initially read.

Can you please post the code you used to get the multiple pages for forum listings working?

Cheers,

Magicspark

Magicspark
Newbie Poster
1 post since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

Hi i got a broken link, can i know where to edit it ?

On page http://www.sgwebhostingtalk.com/f28-hosting-control-panels-and-applications.html
when you click on "MAIN DISCUSSION",
the link to http://www.sgwebhostingtalk.com/forum1.html
gives the error: Not found.

Happens for all the links on that area, Thanks.

ToOnZ
Newbie Poster
6 posts since Aug 2004
Reputation Points: 10
Solved Threads: 0
 

Hello,thanks for all the great info in this thread.I seem to be having a problem with 404's on the index page just as previously stated in the thread by someone else.I havent quite been able to figure this out yet so if someone could possibly give me a hand id appreciate it :)

http://www.non-chalant.com/forum

If you need any extra info let me know,thanks.

Oh,another point,on some of the threadbit edits(particulary step 2)i had a problem with that edit just not existing in my template.As well on Step 7 there was only one instance of the code needing edited and it was stated to be 2.Also there was no accesskey 1 on the end of the only edit of Step 7 i found.Not positive if this has any bearing on my problem or not.I have edited some of my templates previously to make the forum more SEO friendly.Thanks again for the help

xStylezx
Newbie Poster
14 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

Ok,got the index 404 problem figured out myself.Now im having a 404 when i click on an actual thread(forumdisplay).I shall see if i can work this out myself but if anyone has any advice please clue me in as im going at this practicly blind :mrgreen:

xStylezx
Newbie Poster
14 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

awesome mod! works perfectly on my forum! Thanks csgal and Ted!

tekkitan
Newbie Poster
18 posts since Aug 2004
Reputation Points: 10
Solved Threads: 0
 

Alright,no luck so far in figuring out why im getting the 404's when trying to click on a thread.Ive checked some obvious things that would seem to effect it,still 404's.

If anyone could give me a point in the right direction and/or tell me what could be the root of this,im sure i could hack it out :D

xStylezx
Newbie Poster
14 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

Can you provide your URL please and also copy/paste your .htaccess here :)

cscgal
The Queen of DaniWeb
Administrator
19,421 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 229
 

Sure.My url is http://non-chalant.com/forum
And the .htaccess is,

RewriteEngine On
Options +FollowSymLinks
RewriteRule ^t([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 ^f([0-9]+)-(.*).html$ forumdisplay.php?forumid=$1 [L]


Thanks alot for the help ;)

xStylezx
Newbie Poster
14 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You