DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Existing Scripts (http://www.daniweb.com/forums/forum145.html)
-   -   The quick 'n' dirty ultra simple vBulletin SEO hack (http://www.daniweb.com/forums/thread35147.html)

cscgal Nov 10th, 2005 11:52 am
The quick 'n' dirty ultra simple vBulletin SEO hack
 
This is a very quick 'n' simple vBulletin SEO hack. It's easy to apply and it's the one I have been using here on DaniWeb for the past couple of months. I was going to wait until we went vB 3.5 to release it but I might as well do so now ... Disclaimer: This is for vBulletin 3.0.x. It should not be too complicated to port to 3.5 with their hooks system, but I have no experience with 3.5 and therefore don't want to say one way or another. If you use this hack, please link to DaniWeb in your footer. This is a free hack, and it can make or break the traffic to your site. I don't know of any other freely available hacks like this one. Please help us out in exchange for releasing this!

STEP 1: Create an .htaccess file in your forum directory and put the following into it:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^getdaily.html$ search.php?do=getdaily [L]
RewriteRule ^getdaily([0-9]+).html$ search.php?do=getdaily&f=$1 [L]
RewriteRule ^unanswered.html$ search.php?do=process&replyless=1&replylimit=0&dontcache=1    [L]
RewriteRule ^unanswered([0-9]+).html$ search.php?do=process&replyless=1&replylimit=0&dontcache=1&forumchoice=$1&childforums=1 [L]
RewriteRule ^forum([0-9]+).html$        forumdisplay.php?f=$1        [L]
RewriteRule ^forum([0-9]+)-([0-9]+)-([a-z]+)-(.*)-([0-9]+)-(.*).html$ forumdisplay.php?f=$1&page=$2&sort=$3&order=$4&pp=$5&daysprune=$6 [L]
RewriteRule ^forum([0-9]+)-(.*)-([a-z]+)-([a-z]+).html$    forumdisplay.php?f=$1&daysprune=$2&order=$3&sort=$4    [L]
RewriteRule ^announcement([0-9]+).html$    announcement.php?f=$1    [L]
RewriteRule ^announcement([0-9]+)-([0-9]+).html$    announcement.php?f=$1&announcementid=$2 [L]
RewriteRule ^thread([0-9]+).html$    showthread.php?t=$1    [L]
RewriteRule ^thread([0-9]+)-([0-9]+).html$    showthread.php?t=$1&page=$2    [L]
RewriteRule ^getnew.html$ search.php?do=getnew [L]
RewriteRule ^getnew([0-9]+).html$ search.php?do=getnew&f=$1 [L]
RewriteRule ^printthread([0-9]+).html$    printthread.php?t=$1    [L]
RewriteRule ^sendthread([0-9]+).html$    sendmessage.php?do=sendtofriend&t=$1 [L]
RewriteRule ^referthread([0-9]+)-([0-9]+).html$ showthread.php?t=$1&referrerid=$2    [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 ^nextnewesttothread([0-9]+).html$    showthread.php?t=$1&goto=nextnewest    [L]
RewriteRule ^nextoldesttothread([0-9]+).html$    showthread.php?t=$1&goto=nextoldest    [L]
RewriteRule ^post([0-9]+).html$    showthread.php?p=$1    [L]
RewriteRule ^post([0-9]+)-([0-9]+).html$    showpost.php?p=$1&postcount=$2    [L]
RewriteRule ^post([0-9]+)-([0-9]+)-([0-9]+).html$ showthread.php?p=$1&page=$2&pp=$3    [L]
RewriteRule ^thread([0-9]+)-([a-z]+).html$ showthread.php?mode=$2&t=$1    [L]
RewriteRule ^post([0-9]+)-([a-z]+).html$ showthread.php?p=$1&mode=$2    [L]

STEP 2:

In the includes/functions.php file, below
function print_output($vartext, $sendheader = 1)
{
global $pagestarttime, $query_count, $querytime, $DB_site, $bbuserinfo;
global $vbphrase, $vboptions, $stylevar, $_REQUEST;

in 3.0.7 (in another version of 3.0.x, just put the code below the global declarations in the print_output function) add:

 // do Dani's SEO optimization
global $session;
 
$search_array = array(
'#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&amp;page=") . '([0-9]+)' . preg_quote("&amp;sort=") . '([a-z]*)' . preg_quote("&amp;order="). '([a-z]*)' . preg_quote("&amp;pp=") . '([0-9]*)' . preg_quote("&amp;daysprune="). '([^"]*)"#',
'#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&amp;daysprune=") . '([^"]*)' . preg_quote("&amp;order=") . '([a-z]*)' . preg_quote("&amp;sort=") . '([a-z]*)' . preg_quote("&amp;pp=") . '([0-9]*)' . preg_quote("&amp;page=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&amp;daysprune=") . '([^"^&]*)' . preg_quote("&amp;order=") . '([a-z]*)' . preg_quote("&amp;sort=") . '([a-z]*)"#',
'#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&amp;daysprune="). '([^"^&]*)"#',
'#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&amp;page=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)' . preg_quote("&amp;page=") . '([0-9]*)' . preg_quote("&amp;pp=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)' . preg_quote("&amp;page=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]goto=lastpost&amp;t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]goto=newpost&amp;t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"printthread.php?$session[sessionurl]t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"sendmessage.php?$session[sessionurl]do=sendtofriend&amp;t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)' . preg_quote("&amp;goto=next"). '([a-z]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]p=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]p=") . '([0-9]+)' . preg_quote("&amp;page=") . '([0-9]+)' . preg_quote("&amp;pp=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showpost.php?$session[sessionurl]p=") . '([0-9]+)' . preg_quote("&amp;postcount=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]mode=") . '([a-z]+)' . preg_quote("&amp;t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]p=") . '([0-9]+)' . preg_quote("&amp;mode=") . '([a-z]+)\##',
 
'#<a ([^>]*)href' . preg_quote("=\"announcement.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&amp;announcementid=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"announcement.php?$session[sessionurl]f=") . '([0-9]+)"#',
 
// sanitizing
'#<a ([^>]*)href\=\"([^"]*)&amp;page=([^"]*).html"#',
'#<a ([^>]*)href\=\"([^"]*)&amp;highlight=([^"]*).html"#',
 
// other
'#<a ([^>]*)href' . preg_quote("=\"search.php?$session[sessionurl]do=getdaily&amp;f=") . '([0-9]*)"#',
'#<a ([^>]*)href' . preg_quote("=\"search.php?$session[sessionurl]do=getdaily") . '"#',
'#<a ([^>]*)href' . preg_quote("=\"search.php?$session[sessionurl]do=process&amp;replyless=1&amp;replylimit=0&amp;dontcache=1&amp;forumchoice=&amp;childforums=1") . '"#',
'#<a ([^>]*)href' . preg_quote("=\"search.php?$session[sessionurl]do=process&amp;replyless=1&amp;replylimit=0&amp;dontcache=1&amp;forumchoice=") . '([0-9]+)' . preg_quote("&amp;childforums=1") . '"#'
 
);
$replace_array = array(
'<a \1href="forum\2-\3-\4-\5-\6-\7.html"',
'<a \1href="forum\2-\7-\5-\4-\6-\3.html"',
'<a \1href="forum\2-\3-\4-\5.html"',
'<a \1href="forum\2-\3.html"',
'<a \1href="forum\2-\3.html"',
'<a \1href="forum\2.html"',
'<a \1href="thread\2-\3.html"',
'<a \1href="thread\2-\3.html"',
'<a \1href="thread\2.html"',
'<a \1href="lastpostinthread\2.html"',
'<a \1href="newpostinthread\2.html"',
'<a \1href="printthread\2.html"',
'<a \1href="sendthread\2.html"',
'<a \1href="next\3tothread\2.html"',
'<a \1href="post\2.html"',
'<a \1href="post\2-\3-\4.html"',
'<a \1href="post\2-\3.html"',
'<a \1href="thread\3-\2.html"',
'<a \1href="post\2-\3.html#',
 
'<a \1href="announcement\2-\3.html"',
'<a \1href="announcement\2.html"',
 
// sanitizing
'<a \1href="\2-\3.html"',
'<a \1href="\2-\3.html"',
 
// other
'<a \1href="getdaily\2.html"',
'<a \1href="getdaily.html"',
'<a \1href="unanswered.html"',
'<a \1href="unanswered\2.html"'
 
);
$vartext = preg_replace($search_array, $replace_array, $vartext);
Please do not duplicate all or part of this code elsewhere. Thanks should go out to Xenon for suggesting to me that I can rewrite URLs from within this function. Thanks!! ... And, please, give credit where credit is due - if you use this hack, please link back.

Club2share.com Nov 12th, 2005 5:37 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Verynice Hack and is there any chanse we can get this work like the VBSeo from vbseo.com ?

cscgal Nov 13th, 2005 10:07 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Update:

I just took a look at vB 3.5. Based on what I can see - and this still goes untested - add the .htaccess file as mentioned above. Then, throw all the PHP code into the global_complete hook. The only difference to make is the last line should read:

$output = preg_replace($search_array, $replace_array, $output);

We're doing a find/replace on the parsed $output instead of the raw $vartext because, quite simply, a hook doesn't exist earlier in the function. So hopefully it will work.


If for whatever reason that above hook doesn't work, the fail-safe way that will 100% work in vB 3.5 is to add the exact code as in the original tutorial below:
function print_output($vartext, $sendheader = true)
{
global $pagestarttime, $querytime, $vbulletin;
global $vbphrase, $stylevar;

cscgal Nov 13th, 2005 10:16 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Quote:

Originally Posted by Club2share.com
Verynice Hack and is there any chanse we can get this work like the VBSeo from vbseo.com ?

Using directories can be accomplished by simply replacing the .html postfix areas of the code with the / prefix as necessary.

I haven't investigated the code close enough to know whether this function has access to the $thread['title'] variable ... I assume that it does, and if so, you can simply use it in the PHP code, but it remains untested.

Kwak Nov 14th, 2005 4:30 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Hello cscgal,

I've applied the hack to a new style and followed step by step (3 steps was easy :) ).
I found a bug though.
The multi-page links return a 404 error.

The multi-page link show up as
http://www.daniweb.com/techtalkforums/-1-20.html

rather than

http://www.daniweb.com/techtalkforum...ad34695-1.html

cscgal Nov 14th, 2005 11:51 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
This hack has been tested to have no problems on both a vB 3.0.7 installation as well as a vB 3.5 installation - both by editing the functions.php file as mentioned above. It has not yet been tested using the 3.5 hooks method.

Which version are you working with?

Kwak Nov 14th, 2005 1:18 pm
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Quote:

Originally Posted by cscgal
This hack has been tested to have no problems on both a vB 3.0.7 installation as well as a vB 3.5 installation - both by editing the functions.php file as mentioned above. It has not yet been tested using the 3.5 hooks method.

Which version are you working with?

It is for version 3.0.3.
I may have edited a few templates from the previous mod_rewrite hack so I'll get on this later this week and see where the problem lies. Thanks.

cscgal Nov 14th, 2005 1:31 pm
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Yes, that seems like it's almost definitely the problem. :)

Kwak Nov 16th, 2005 6:16 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
I've reverted the templates and files to the default stage. And whala~ everything is good to go.


Except two things:

Quote:

1) New post links in the forumhome goes to the .php page rather than .html.
e.g. http://www.daniweb.com/techtalkforum...hread2379.html link takes you to http://www.daniweb.com/techtalkforum...4318#post14318

Quote:

2) In the online.php? page, if the visitor (a google bot) is looking at a specific posts in a thread, e.g. http://www.daniweb.com/techtalkforum...08#postid=8308
it shows up as a .php? rather than a .html

but all other threads show up properly as .html. So only when a member or a visitor is at a specific post, the link in the online.php? page shows up in such a way.

cscgal Nov 17th, 2005 9:50 pm
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
My hack only alters URLs in templates, not URLs that were generated in the php files themselves. If you want to fix problem #1 you illustrated, you would have to start editing PHP files. It's a trade off whether you want to be 100% SEO'ed or whether you want the hack to be self-contained. For me, I don't care about it redirecting to the non-SEO'd version as long as the spiders get a taste of newpostinthread.html and lastpostinthread.html

To answer your second question, I didn't bother SEO'ing this because spiders never see the online.php page, it should be set to members-only access.

Kwak Nov 17th, 2005 10:48 pm
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
That makes clear sense. Thank you.

Kwak Nov 18th, 2005 1:35 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Found a new bug, the LastPage multi-page link sends to a 404 error on my board


http://www.daniweb.com/techtalkforum...hread1780.html (I've replaced my board URL with daniweb)


I double checked the .htaccess. Which template must I check to resolve this bug?

Thanks for your help thus far.

cscgal Nov 18th, 2005 10:49 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
It's supposed to be lastpostinthread, not lastposttothread. DaniWeb doesn't seem to be experiencing this problem? Can you confirm that DaniWeb has the same bug? I'm not sure why it's doing what it's doing, but this should eliminate the problem:

To fix it, in functions.php:

Replace
[php]
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)' . preg_quote("&amp;goto="). '([a-z]+)"#',[/php]
with
[php]
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)' . preg_quote("&amp;goto=next"). '([a-z]+)"#',[/php]

Also, replace
[php]'<a \1href="\3tothread\2.html"', [/php]
with
[php]'<a \1href="next\3tothread\2.html"', [/php]

I have edited the first post to reflect this change.

WebDressing Nov 19th, 2005 5:42 pm
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Great thread. Has 3.5.1 been confirmed to work with this? (vs. 3.5) :?:

Christoph Nov 21st, 2005 8:07 pm
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
The hack works fine, yet would it be possible to change to ‘forum1 and post1’ into ‘forum title and post title’?

Thanks.

WebDressing Nov 22nd, 2005 11:34 pm
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
We wanted to make sure that we understand how to correctly install this hack in 3.5.1 before we blow something up :mrgreen:

First we make the .htaccess file, and then we find this code in the includes/functions.php file:

function print_output($vartext, $sendheader = true)
{
global $pagestarttime, $querytime, $vbulletin;
global $vbphrase, $stylevar;

and then we add this below it:

// do Dani's SEO optimization
global $session;

$search_array = array(
'#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&amp;page=") . '([0-9]+)' . preg_quote("&amp;sort=") . '([a-z]*)' . preg_quote("&amp;order="). '([a-z]*)' . preg_quote("&amp;pp=") . '([0-9]*)' . preg_quote("&amp;daysprune="). '([^"]*)"#',
'#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&amp;daysprune=") . '([^"^&]*)' . preg_quote("&amp;order=") . '([a-z]*)' . preg_quote("&amp;sort=") . '([a-z]*)"#',
'#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&amp;daysprune="). '([^"^&]*)"#',
'#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&amp;page=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)' . preg_quote("&amp;page=") . '([0-9]*)' . preg_quote("&amp;pp=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)' . preg_quote("&amp;page=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]goto=lastpost&amp;t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]goto=newpost&amp;t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"printthread.php?$session[sessionurl]t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"sendmessage.php?$session[sessionurl]do=sendtofriend&amp;t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)' . preg_quote("&amp;goto=next"). '([a-z]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]p=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]p=") . '([0-9]+)' . preg_quote("&amp;page=") . '([0-9]+)' . preg_quote("&amp;pp=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showpost.php?$session[sessionurl]p=") . '([0-9]+)' . preg_quote("&amp;postcount=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]mode=") . '([a-z]+)' . preg_quote("&amp;t=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]p=") . '([0-9]+)' . preg_quote("&amp;mode=") . '([a-z]+)\##',

'#<a ([^>]*)href' . preg_quote("=\"announcement.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&amp;announcementid=") . '([0-9]+)"#',
'#<a ([^>]*)href' . preg_quote("=\"announcement.php?$session[sessionurl]f=") . '([0-9]+)"#',

// sanitizing
'#<a ([^>]*)href\=\"([^"]*)&amp;page=([^"]*).html"#',
'#<a ([^>]*)href\=\"([^"]*)&amp;highlight=([^"]*).html"#',

// other
'#<a ([^>]*)href' . preg_quote("=\"search.php?$session[sessionurl]do=getdaily&amp;f=") . '([0-9]*)"#',
'#<a ([^>]*)href' . preg_quote("=\"search.php?$session[sessionurl]do=getdaily") . '"#',
'#<a ([^>]*)href' . preg_quote("=\"search.php?$session[sessionurl]do=process&amp;replyless=1&amp;replylimit=0&amp;dontcache=1&amp;forumchoice=&amp;childforums=1") . '"#',
'#<a ([^>]*)href' . preg_quote("=\"search.php?$session[sessionurl]do=process&amp;replyless=1&amp;replylimit=0&amp;dontcache=1&amp;forumchoice=") . '([0-9]+)' . preg_quote("&amp;childforums=1") . '"#'

);
$replace_array = array(
'<a \1href="forum\2-\3-\4-\5-\6-\7.html"',
'<a \1href="forum\2-\3-\4-\5.html"',
'<a \1href="forum\2-\3.html"',
'<a \1href="forum\2-\3.html"',
'<a \1href="forum\2.html"',
'<a \1href="thread\2-\3.html"',
'<a \1href="thread\2-\3.html"',
'<a \1href="thread\2.html"',
'<a \1href="lastpostinthread\2.html"',
'<a \1href="newpostinthread\2.html"',
'<a \1href="printthread\2.html"',
'<a \1href="sendthread\2.html"',
'<a \1href="next\3tothread\2.html"',
'<a \1href="post\2.html"',
'<a \1href="post\2-\3-\4.html"',
'<a \1href="post\2-\3.html"',
'<a \1href="thread\3-\2.html"',
'<a \1href="post\2-\3.html#',

'<a \1href="announcement\2-\3.html"',
'<a \1href="announcement\2.html"',

// sanitizing
'<a \1href="\2-\3.html"',
'<a \1href="\2-\3.html"',

// other
'<a \1href="getdaily\2.html"',
'<a \1href="getdaily.html"',
'<a \1href="unanswered.html"',
'<a \1href="unanswered\2.html"'

);
$vartext = preg_replace($search_array, $replace_array, $vartext);

Is that correct :?:

Thank you.

cscgal Nov 24th, 2005 1:14 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Yes. Doing is that way is guaranteed to work.

The second way is to use hooks, but no one has yet confirmed that my hooks method works.

Kwak Nov 24th, 2005 1:18 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
DaniWeb website works smoothly. The code you've provided, I could not find it on functions.php file for version 3.0.3.

Hmm... :confused:
Quote:

Originally Posted by cscgal
It's supposed to be lastpostinthread, not lastposttothread. DaniWeb doesn't seem to be experiencing this problem? Can you confirm that DaniWeb has the same bug?


cscgal Nov 24th, 2005 11:54 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Kwak,

The lines that I asked you to replace (in post #13) to fix the lastpostinthread bug are located within the code that you were supposed to add to functions.php in the original tutorial. They aren't naturally in functions.php

Kwak Nov 24th, 2005 11:49 pm
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Thanks once again. The last page link works (not in .html) perfectly.

cscgal Nov 25th, 2005 5:02 pm
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Huh? What do you mean not in html?

yakusasci Nov 26th, 2005 6:18 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Hi Dani,

Just two questions : when I click on http://www.daniweb.com/techtalkforum...read35782.html the url becomes http://www.daniweb.com/techtalkforum...591#post176591 so not in your seo hack spirit ; is-it normal ?

You don't seem to use VB 3.5 ; could you confirm a date for a potentiel complete release of you great hack for VB3.5 with the hook system ?

Tks !

Yakusasci

cscgal Nov 26th, 2005 11:47 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Your first question was answered in post #10 of this thread.

A hooks version of my hack is available in post #3. It should work, but remains untested.

alarach Dec 2nd, 2005 6:04 pm
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Any idea how to change the "forum number" by "forum title"? :?:

Quote:

Originally Posted by Christoph
The hack works fine, yet would it be possible to change to ‘forum1 and post1’ into ‘forum title and post title’?

Thanks.


yakusasci Dec 3rd, 2005 3:12 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Ok tks dani ; another "bug" on your forum :

on this page http://www.daniweb.com/techtalkforum...esc-views.html if I click on the arrow to order asc I get this url : http://www.daniweb.com/techtalkforum...s&pp=40&page=1.

yakusasci Dec 3rd, 2005 8:17 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
A bug on test VB3.5.1 forum (hook system works find): on a page like forum90.html in the navbar I get forumdisplay.php?f=90&page=6&order=desc and not something like forum8-4-lastpost--40--1.html. Hope this helps !

cscgal Dec 4th, 2005 3:18 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Quote:

Originally Posted by yakusasci
Ok tks dani ; another "bug" on your forum :

on this page http://www.daniweb.com/techtalkforum...esc-views.html if I click on the arrow to order asc I get this url : http://www.daniweb.com/techtalkforum...&pp=40&page=1.

To fix this:

Below
  '#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&amp;page=") . '([0-9]+)' . preg_quote("&amp;sort=") . '([a-z]*)' . preg_quote("&amp;order=") . '([a-z]*)' . preg_quote("&amp;pp=") .  '([0-9]*)' . preg_quote("&amp;daysprune=") . '([^"]*)"#',
add
  '#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&amp;daysprune=") . '([^"]*)' . preg_quote("&amp;order=") . '([a-z]*)' . preg_quote("&amp;sort=") . '([a-z]*)' . preg_quote("&amp;pp=") .  '([0-9]*)' . preg_quote("&amp;page=") . '([0-9]+)"#',
and below
  '<a \1href="forum\2-\3-\4-\5-\6-\7.html"',
add
  '<a \1href="forum\2-\7-\5-\4-\6-\3.html"',

I am going to update the original post to reflect this change.

WMTalker Dec 6th, 2005 11:38 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
is it possible to get this? www.mysite.com/forums1.html to
www.mysite.com/(forumtitle)-1.html ??

cscgal Dec 6th, 2005 11:54 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Not by making any easy changes to the current hack. The reason is because it simply parses entire templates - and has no access to $thread[].

mariuscarneala Dec 9th, 2005 10:30 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
I get a 500 internal server error and in access log I read this:

[Fri Dec 9 16:16:00 2005] [alert] [client 81.196.xx.xx] /home/xxxxxxx/public_html/forum/.htaccess: RewriteRule: bad argument line '^nextnewesttothread([0-9]+).html$showthread.php?t=$1&goto=nextnewest[L]'\n

Thanks

mariuscarneala Dec 10th, 2005 10:00 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Anybody here??

cscgal Dec 10th, 2005 12:19 pm
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
The fact that your error message contains \n, an end of line marker, leads me to believe that your problem lies in the editor you are using. Your .htaccess file should be a plain text file in ASCII uploaded to your forum directory. Additionally, it should not all be smashed together as in your post - notice how there are tabs separating each part of a line in the tutorial?

mariuscarneala Dec 10th, 2005 12:34 pm
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Thank you! Now it works. It was the missing tab characters, because my browser, Opera 9, couldn't copy all the chars correctly.

Thanks again!

lifepower Dec 11th, 2005 7:19 pm
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
I've just applied the patch and I think there is a bug. When reading a thread, i.e. "thread203.html", when I change the style (from drop-down box on top-left), the link becomes "thread203.html?styleid=5", which shows exactly the same page with no style updated. I'm using vB 3.5.2. Is there any way to fix this?

You can see this at this link. Try changing the style on bottom-left.

P.S. Thanks a lot for the patch, very nice! ;)

g0rb4ch3v Dec 14th, 2005 12:27 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Thanks! I will try this on vB 3.5.2 tonight!

Edit: The hook did not work for me :(

g0rb4ch3v Dec 14th, 2005 12:59 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Quote:

Originally Posted by g0rb4ch3v
Thanks! I will try this on vB 3.5.2 tonight!

Edit: The hook did not work for me :(

Edit: Either did editing functions.php - It linked to the forum at forum1.html (for example) but when you click it, it 404'ed

WebDressing Dec 14th, 2005 10:58 pm
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Quote:

Originally Posted by cscgal
I am going to update the original post to reflect this change.

Hi cscgal, none of those changes need to be made in the 3.5.x version do they?

cscgal Dec 21st, 2005 12:16 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
g0rb4ch3v, did you create and upload the .htaccess file?

WebDressing: Yes, they do apply. If you installed this prior to December 4th, I suggest you make the update. => http://www.daniweb.com/techtalkforum...178164-27.html. Otherwise, you should be fine.

WebDressing Dec 21st, 2005 12:29 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Quote:

Originally Posted by cscgal
WebDressing: Yes, they do apply. If you installed this prior to December 4th, I suggest you make the update.

OK thank you Dani, we'll look at that now.

I hope you have a wonderful holiday too ;)

vijay79758 Dec 22nd, 2005 9:39 am
Re: The quick 'n' dirty ultra simple vBulletin SEO hack
 
Hi!

The hack is real good...i am working on implementing on my site which used vbulletin 3.0.3

I got the following error after uploading .htaccess file in the root folder of mysite.

----------
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

----------

any inputs pls. to fix it?

Thank you.


All times are GMT -4. The time now is 9:54 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC