![]() |
| ||
| 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 STEP 2: In the includes/functions.php file, below function print_output($vartext, $sendheader = 1) 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 optimizationPlease 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. |
| ||
| 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 ? |
| ||
| 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) |
| ||
| Re: The quick 'n' dirty ultra simple vBulletin SEO hack Quote:
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. |
| ||
| 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 |
| ||
| 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? |
| ||
| Re: The quick 'n' dirty ultra simple vBulletin SEO hack Quote:
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. |
| ||
| Re: The quick 'n' dirty ultra simple vBulletin SEO hack Yes, that seems like it's almost definitely the problem. :) |
| ||
| 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:
Quote:
|
| ||
| 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. |
| ||
| Re: The quick 'n' dirty ultra simple vBulletin SEO hack That makes clear sense. Thank you. |
| ||
| 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. |
| ||
| 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("&goto="). '([a-z]+)"#',[/php] with [php] '#<a ([^>]*)href' . preg_quote("=\"showthread.php?$session[sessionurl]t=") . '([0-9]+)' . preg_quote("&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. |
| ||
| 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) :?: |
| ||
| 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. |
| ||
| 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) and then we add this below it: // do Dani's SEO optimization Is that correct :?: Thank you. |
| ||
| 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. |
| ||
| 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:
|
| ||
| 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 |
| ||
| Re: The quick 'n' dirty ultra simple vBulletin SEO hack Thanks once again. The last page link works (not in .html) perfectly. |
| ||
| Re: The quick 'n' dirty ultra simple vBulletin SEO hack Huh? What do you mean not in html? |
| ||
| 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 |
| ||
| 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. |
| ||
| Re: The quick 'n' dirty ultra simple vBulletin SEO hack Any idea how to change the "forum number" by "forum title"? :?: Quote:
|
| ||
| 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. |
| ||
| 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 ! |
| ||
| Re: The quick 'n' dirty ultra simple vBulletin SEO hack Quote:
Below '#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&page=") . '([0-9]+)' . preg_quote("&sort=") . '([a-z]*)' . preg_quote("&order=") . '([a-z]*)' . preg_quote("&pp=") . '([0-9]*)' . preg_quote("&daysprune=") . '([^"]*)"#', add '#<a ([^>]*)href' . preg_quote("=\"forumdisplay.php?$session[sessionurl]f=") . '([0-9]+)' . preg_quote("&daysprune=") . '([^"]*)' . preg_quote("&order=") . '([a-z]*)' . preg_quote("&sort=") . '([a-z]*)' . preg_quote("&pp=") . '([0-9]*)' . preg_quote("&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. |
| ||
| Re: The quick 'n' dirty ultra simple vBulletin SEO hack |
| ||
| 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[]. |
| ||
| 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 |
| ||
| Re: The quick 'n' dirty ultra simple vBulletin SEO hack Anybody here?? |
| ||
| 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? |
| ||
| 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! |
| ||
| 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! ;) |
| ||
| 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 :( |
| ||
| Re: The quick 'n' dirty ultra simple vBulletin SEO hack Quote:
|
| ||
| Re: The quick 'n' dirty ultra simple vBulletin SEO hack Quote:
|
| ||
| 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. |
| ||
| Re: The quick 'n' dirty ultra simple vBulletin SEO hack Quote:
I hope you have a wonderful holiday too ;) |
| ||
| 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