PDA

View Full Version : Fix the stock vBulletin header link



Joeychgo
03-06-2006, 09:55 AM
You might wonder - whats wrong with it?

For search engines to properly index and assign pagerank, you need your links to be consistant. This is where the problem comes in. you dont generally link to the stock URL, but instead to the simple URL.




Stock - the link looks like this:
http://www.vbulletin-faq.com/forum/index.php





Now this forum is not in the root directory, as many are. If it was the link would look like this:
http://www.vbulletin-faq.com/index.php





What you want, is for it to look like this:
http://www.vbulletin-faq.com/forum/





So. Here is how to make this simple change.

In the Header Template look for this code:



<td align="$stylevar
"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>




Change the part in blue to the URL of your homepage or forumhome. On this site, it looks like this:





<td align="$stylevar[LEFT]"><a href="http://www.vbulletin-faq.com"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>





Now, while we're at it, lets change the navbar breadcrumb, which has the same problem.


Open the navbar template and find this code:





<td width="100%"><span class="navbar"><a href="$vboptions[forumhome].php$session[sessionurl_q]" accesskey="1">$vboptions[bbtitle]</a></span> $navbits[breadcrumb]</td>



Replace it with this:




<td width="100%"><span class="navbar"><a href="http://www.yourforum.com/forum/" accesskey="1">$vboptions[bbtitle]</a></span> $navbits[breadcrumb]</td>

[LEFT]Be sure to change the red to your foum url.


Also look for this:



<div class="navbar" style="font-size:10pt"><a href="$vboptions[forumhome].php$session[sessionurl_q]" accesskey="1"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_start.gif" alt="" border="0" /></a> <strong>$vboptions[bbtitle]</strong></div>


Replace it with this:



<div class="navbar" style="font-size:10pt"><a href="http://www.yourforum.com/forum/" accesskey="1"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_start.gif" alt="" border="0" /></a> <strong>$vboptions[bbtitle]</strong></div>


Again, be sure to change the red to your foum url.


I prefer to have the header lead to the homepage, and the breadcrumb to lead to the forum home url.

Mike
05-15-2006, 07:02 PM
Joey, I have this and the other seo mods on my site. I wonder if you know how to take this specific mod a little further though. I am looking around to try to figure it out, but haven't yet.

In the "forum jump" menu the forums home link goes to /forum/index.php

You know how to fix that one as well?

Joeychgo
05-16-2006, 12:48 AM
In the forumsjump template I would imagine.

Mike
05-16-2006, 06:49 PM
I found that, but had no idea how to modify it after looking at it. Thought maybe you would have an idea.

Joeychgo
05-16-2006, 06:56 PM
I found that, but had no idea how to modify it after looking at it. Thought maybe you would have an idea.

THat one is a little beyond my coding abilitiy. I was hoping Tgreer ot noppid would jump in on this.

Coder1
06-09-2006, 07:20 AM
Sorry, just now saw this thread and my name in it. I'm not sure I understand this... by default (well, not really, but essentially - skip the long explanation), any URL that ends with a folder name, when the browser navigates to it, the server will return the "default" page within that folder. So a link that looks like http://www.vbulletin-faq.com/forum/ will actually return http://www.vbulletin-faq.com/forum/index.php (or index.html, index.htm, etc.).

That being the case, I don't understand what this modification is doing.

Darwa
08-14-2006, 12:07 AM
Any chance you could update this for 3.6.0 please?

The template looks a bit different, and I don't want to mess anything up :)

Joeychgo
08-14-2006, 12:54 AM
Just change
$vboptions[forumhome].php$session[sessionurl_q] to your full URL

Darwa
08-14-2006, 01:40 AM
Just what I thought. Better to be safe than sorry though :)

Thanks Joey.

TECK
08-27-2006, 06:58 AM
Joey, what if I want to change the index.php to forum.php one day?
And you should use:
$vbulletin->options[homeurl]
$vbulletin->options[bburl]
instead.

Noppid
08-27-2006, 10:15 PM
Joey, what if I want to change the index.php to forum.php one day?
And you should use:
$vbulletin->options[homeurl]
$vbulletin->options[bburl]
instead.

Then you revert the template. It's a built in feature of vBulletin. Nothing to buy. :)

If your reply was a suggesion, it's flawed. You can not reference an object in a vBulletin template as of yet. ;)

TECK
08-28-2006, 09:21 AM
Then you revert the template. It's a built in feature of vBulletin. Nothing to buy. :)

If your reply was a suggesion, it's flawed. You can not reference an object in a vBulletin template as of yet. ;)
I presume that you know how to reference the variables in templates ($vbulletin->options = $vboptions)?
Or you are good only at insulting people, as usual? Your smilies don't cut it.

Joey wrote the tutorial, so I simply wanted to give him a hint, from a coder's view.
I'm sure he knows that:
$vbulletin->options['bburl'] = $vboptions[bburl]

Noppid
08-28-2006, 10:07 AM
I presume that you know how to reference the variables in templates ($vbulletin->options = $vboptions)?
Or you are good only at insulting people, as usual? Your smilies don't cut it.

Joey wrote the tutorial, so I simply wanted to give him a hint, from a coder's view.
I'm sure he knows that:
$vbulletin->options['bburl'] = $vboptions[bburl]

May be that's what you intended, but it's only written in this quoted post, not the first post in which you were trying to be helpful.

As for how to use vboptions and bbuserinfo in templates myself, I'm well aware of the correct syntax.

thanks

TECK
08-28-2006, 11:03 AM
May be that's what you intended, but it's only written in this quoted post, not the first post in which you were trying to be helpful.

As for how to use vboptions and bbuserinfo in templates myself, I'm well aware of the correct syntax.

thanks
The post was adressed to Joey and I'm positive he knows about what I ment in my first post.
Even a first time user will see it, in any template that involves vBulletin options.

Noppid
08-28-2006, 11:47 AM
We try to be more helpful usually be letting everyone in on the idea behind our posts. I know what you are talking about and missed your point. For information to be useful, anyone that reads it should be able to "get it".

Thanks for your comments.

minstrel
10-15-2006, 09:18 AM
$vboptions[forumhome].php$session[sessionurl_q]

Question:

Wouldn't it be simpler to change either forumhome or sessionurl_q or whatever to reflect your chosen home URL? That is, can I change the variable to http://forum.psychlinks.ca from http://forum.psychlinks.ca/index.php so that I don't have to edit this every time I do an upgrade or hard code the changes in mutliple templates?

minstrel
10-19-2006, 11:12 AM
Question:

Wouldn't it be simpler to change either forumhome or sessionurl_q or whatever to reflect your chosen home URL? That is, can I change the variable to http://forum.psychlinks.ca from http://forum.psychlinks.ca/index.php so that I don't have to edit this every time I do an upgrade or hard code the changes in mutliple templates?

Just installed Zoints SEO - this automates it, even without enabling the mod_rewrite features (or indeed any othjer features).

Advantage: No hardcoding and no need to redo that hardcoding with vBulletin updates. :)

Hell³
10-19-2006, 01:36 PM
Good, I might try the Zoints SEO too. I'm very pleased with the tags mod.

Soko
05-31-2007, 09:29 PM
Well, I tried this and now my header is all messed up. Can you take a look at www.clubshutterbug.com and tell me what I might have done wrong?

Darrin

Joeychgo
05-31-2007, 11:23 PM
Well, yes and no.

I know what you did but not how you did it specifically. In this case you were only suppose to change the header LINK, not the image placement. You changed the image placement. Since you ahve a skin, I cant tell you specifically what you did. You'll have to have your skin designer give you a copy of how that template is suppose to be.

Soko
06-02-2007, 09:25 PM
Ok, I am running vbulletin 3.6.5. Can you update for this please, so i dont mess up my header again! :)

Peggy
06-02-2007, 09:29 PM
Soko this isn't written for any certain version. It's written for default vBulletin, or for sites with simple vB styles.

If one has a custom skin, it's a given that the code will be different. :)

Soko
06-02-2007, 09:42 PM
Soko this isn't written for any certain version. It's written for default vBulletin, or for sites with simple vB styles.

If one has a custom skin, it's a given that the code will be different. :)

I am confused, which is easily done. Can I post the code here, and let you tell me what to edit?

Darrin

Soko
06-02-2007, 09:47 PM
<!-- begin surge header-->
<div align="center">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="border">
<tr>
<td align="left" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="221" height="113" rowspan="3"><img src="$stylevar[imgdir_misc]/surge_hdr_ls.gif" width="221" height="113" alt="" /></td>
<td width="100%" height="113" rowspan="3" style="background-image: url($stylevar[imgdir_misc]/surge_hdr_x.gif)"><img src="$stylevar[imgdir_misc]/clear.gif" width="100%" height="1" alt="" /></td>
<td width="531" height="77" colspan="7"><img src="$stylevar[imgdir_misc]/surge_hdr_top.gif" width="531" height="77" alt="" /></td>
</tr>
<tr>

I put the image I am wanting to be a link in bold!

Joeychgo
06-02-2007, 10:01 PM
Try using this

Replace this line


<td width="221" height="113" rowspan="3"><img src="$stylevar[imgdir_misc]/surge_hdr_ls.gif" width="221" height="113" alt="" /></td>

With this...


<td width="221" height="113" rowspan="3"><a href="http://www.clubshutterbug.com/"><img src="$stylevar[imgdir_misc]/surge_hdr_ls.gif" width="221" height="113" alt="Club Shutter Bug" /></td>

Peggy
06-02-2007, 10:07 PM
Um, correction..... use this:


<td width="221" height="113" rowspan="3"><a href="http://www.clubshutterbug.com/"><img src="$stylevar[imgdir_misc]/surge_hdr_ls.gif" width="221" height="113" alt="Club Shutter Bug" /></a></td>

Soko
06-02-2007, 10:14 PM
Um, correction..... use this:


<td width="221" height="113" rowspan="3"><a href="http://www.clubshutterbug.com/"><img src="$stylevar[imgdir_misc]/surge_hdr_ls.gif" width="221" height="113" alt="Club Shutter Bug" /></a></td>


Weeeee! It worked! Except it put a purple box around that link! How do I get rid of that? Check it out!

www.clubshutterbug.com

Peggy
06-02-2007, 10:16 PM
No it didn't work, that friggin header image is our of whack again! damn damn damn!! :mad:
If you want to, give me admin access to your acp so I can fix the friggin thing.

Soko
06-02-2007, 10:19 PM
check your pm!

Peggy
06-02-2007, 10:30 PM
there - fixed. DAMN, I'm good. :D

Soko
06-02-2007, 10:33 PM
there - fixed. DAMN, I'm good. :D

Will you marry me? LOL

Peggy
06-02-2007, 10:35 PM
LOL - not a chance. I'm not marriage material. :p

Soko
06-02-2007, 10:37 PM
Ha ha, Im not either, but my wife has kept me around through all these vbulletin problems! I guess I had better keep her, huh?

Thanks a ton, I guess tommorrow ill work on putting all my ads back in place!

Soko (Darrin)

Peggy
06-02-2007, 10:40 PM
That would be a very good idea! Me - I'm happily single, and staying that way :D

You're very welcome.

Soko
06-02-2007, 10:57 PM
There is one other thing I could use help on that I have been working on for days now, maybe even weeks. Every time I move a module to the right hand side of the page, it makes the module that I move turn skinny! If you have time and dont mind, log back in and see if you can figure that one out. I dont have a module over there now, but try moving the latest poll module over and look at it with internet explorer! I am not sure if it does in with mozilla, which leads me to believe it might be a vbulletin problem with IE7!

I got to go to bed, wife is calling, but if you can I greatly appreciate it!

Darrin

Peggy
06-02-2007, 11:02 PM
You'll have to pm me the info again, I've already deleted it.

Peggy
06-02-2007, 11:16 PM
Well I tried. I can't figure that one out Darrin. You'll have to ask about that at vBAdvanced.

Dave A
06-02-2007, 11:41 PM
There are two possibilities:

Change the right hand colomn width
Admin CP > cBa CMPS > Default settings > Options > Right hand column width (set in pixels)

Also, vBa tends to use a different format in the side columns as opposed to the centre column for some modules.

/And then I look closer and see you're using 3.0 - Not sure now. As I recall they've changed some of the module positioning functionality in the move from 2.x to 3.0.

Peggy
06-02-2007, 11:49 PM
Yeah they did. I was in there a while ago. Tried the width changing. Tried a bunch of things, actually. No go.

Soko
06-03-2007, 07:57 AM
I have been messing with this for days. Seems the problem happened when I upgraded to vbadvanced 3.0!

Soko
06-03-2007, 08:06 AM
Ah ha! Fixed. I just deleted a module that was inactive and it fixed it. Seems the video module was throwing things all out of whack!

Darrin

Peggy
06-03-2007, 08:20 AM
Good, I'm glad you got it fixed! :app:

Fireproof
06-17-2007, 08:11 AM
Just installed Zoints SEO - this automates it, even without enabling the mod_rewrite features (or indeed any othjer features).

Advantage: No hardcoding and no need to redo that hardcoding with vBulletin updates. :)

Hey Minstrel - I have Zoints SEO as well and couldn't find where to make this work. My header and breadcrumb links still needed fixing. If you have advice, let me know.

In the meantime, I hardcoded it per Joey's instructions and it works great.

Thanks guys!
:)

Mike54
06-17-2007, 10:35 AM
Hey Minstrel - I have Zoints SEO as well and couldn't find where to make this work.
Are you referring to cleaning up the Home URL?

Zoints SEO > SEO Options > Fix links to index.php > Yes > Save

Joeychgo
06-17-2007, 11:10 AM
I prefer it hardcoded myself.

Dave A
09-30-2007, 08:11 AM
Oh happy day! I've just discovered my forums/ is PR 2 and my forums/index.php is PR 3.

The joys of changing hosting a few times - all the hard work I did on .htaccess over a year ago to stop this nonsense got undone somewhere along the way. Anyone got a way to force forums/ to forums/index.php via .htaccess? That's the way I had it set up originally for some reason (apart from consistency I forget why exactly) - or maybe I should go the reverse way?

Dave A
09-30-2007, 11:54 AM
Just tested this here too. forum/index.php = PR4 and forum/ = PR5

I know this was one of my first SEO "fixes", but I just can't find how I solved it exactly. I'm pretty sure it was a 301 redirect in .htaccess.

Joeychgo
09-30-2007, 02:00 PM
yeah, just a 301 redirect.

Dave A
09-30-2007, 10:14 PM
yeah, just a 301 redirect.
That was somewhat cryptic :p
and the code would be....

Big Dan
10-01-2007, 03:22 AM
That was somewhat cryptic :p
and the code would be....

Psst... Joey keeps it top secret: http://www.vbulletin-faq.com/forum/showthread.php?t=886&highlight=redirect ;)

That's the base just fill in your info. :)

Dave A
10-01-2007, 04:23 AM
Psst... Joey keeps it top secret: http://www.vbulletin-faq.com/forum/showthread.php?t=886&highlight=redirect ;)

That's the base just fill in your info. :)
Thanks Dan, but that resolves the www. problem. What I'm looking to solve is the domain/index.php vs domain/ problem.

Dave A
10-01-2007, 01:13 PM
Some progress (of sorts).

The following additions to your .htaccess files will fix as follows (assumes RewriteEngine On is already present).

For domain.com/index.php add the following to your .htaccess file in your public_html folder:


RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.%{HTTP_HOST}/ [R=301,NS,L]

For domain.com/forums/index.php add the following to your .htaccess file in your /forums folder (if you use /forum - delete the s in forums in the code below). Here I've shown the combination of the www. fix and the index.php fix:


RewriteEngine On

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /forums/index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.%{HTTP_HOST}/forums/ [R=301,NS,L]

RewriteCond %{HTTP_HOST} !^www
RewriteRule (.*) http://www.%{HTTP_HOST}/forums/$1 [R=301,L]

Now all I've got to figure out is how to change URLs like domain.com/index.php?page=topic to domain.com/?page=topic and we're cooking!