Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-16-2011, 11:27 AM
valdet's Avatar
valdet valdet is offline
 
Join Date: Feb 2007
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default External links are made to look like part of my site

Hi all,

I am having a rather strange issue with external links posted in my threads.

I will kindly ask if anyone had the same issue with external links ?
Here's my problem.

When a forum user posts a link with no http:// and with no www (e.g. just vbulletin.org ), then this link will become like a part of my site in the shape of http://www.mysite.com/forum/vbulletin.org which is obviously reported as a 404.

Here's an example link to see it in actionhttp://www.insurance-forums.net/forum/insurance-websites/has-anyone-built-facebook-page-their-business-t31088.html#post388403

See the facebook and the other URL how they're linked

There are no problems when links are, for example posted as www.vbulletin.org or http://www.vbulletin.org or any other shape, it's just that when there's no prefix (http and www) the links are rewritten wrongly as above.

I have vBSEO so I completely disabled it, I disabled hooks, renamed htaccess and this behaviour keeps happening.

I hope someone can help me on this strange issue if ever encountered something similar.

Thanks.
Val.
Reply With Quote
  #2  
Old 05-16-2011, 02:48 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you try posting a link after disabling all your mods or just look to see if the links had "changed" back to normal? It looks like the links were added that way to the post, so disabling mods is not going to change the existing ones at all.
Reply With Quote
  #3  
Old 05-16-2011, 03:49 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I find that if you post facebook.com/something or facebook.com/something you get a link that goes to facebook.com, but if you press the link button and paste facebook.com/something into the popup, you get a link to your own site. I'm not sure why that is, but I think when you use the button it inserts an html link (rather than a url bbcode), so probably whatever turns that back in to bbcode is seeing it as a relative link.
Reply With Quote
  #4  
Old 05-16-2011, 07:05 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i'd say this s probably user error... the "http://" is pre-filled in the link box for a reason, it probably needs to be used.
Reply With Quote
  #5  
Old 05-16-2011, 07:46 PM
valdet's Avatar
valdet valdet is offline
 
Join Date: Feb 2007
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As kh99 said, it is only happening on cases when users enter simple URLs (with no http:// and no www.) into the hyperlink popup.

Just as in below screenshot
http://www.insurance-forums.net/vbseo.png

Any ideas ??
Reply With Quote
  #6  
Old 05-16-2011, 07:59 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In include/functions_wysiwyg.php, in function parse_wysiwyg_anchor() around line 435 is this code:

Code:
if (!preg_match('#^[a-z0-9]+:#i', $href))
{
	// relative URL, prefix it with the URL to this board
	$href = create_full_url($href);
}

if you comment that part out, it will work more like you are expecting. But I'm not sure what else it might affect, and like Lynne pointed out it won't fix existing links.

ETA: Or instead of commenting it out you mgiht be able to do something more sophisticated like check if anything before the first '/' looks like a domain name.

...but BOP was also right, if you include the http:// in the popup it will work, but the problem (at least on IE) is that the http:// seems to come up selected so when you start typing it goes away.
Reply With Quote
  #7  
Old 05-17-2011, 09:46 AM
valdet's Avatar
valdet valdet is offline
 
Join Date: Feb 2007
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What's even more strange is that following steps as in the screenshot, returns the
correct URL in Google Chrome, but fails to do so in Firefox 4 and IE8

Let's test vb.org here through all three browsers:

FF 4
vbulletin.org

Chrome:
vbulletin.org

IE8:
vbulletin.org

As you see only Chrome returns the correct URL.
Reply With Quote
  #8  
Old 05-17-2011, 10:23 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I believe this has to do with browsers recognizing or not the "base" URL tag in the header.
In your HTML source do you have this line of code?

Code:
<base href="YOUR FORUM URL" />
or any <base> tags? By default vbulletin 3.x doesn't have them I think it could be the cause.
Reply With Quote
  #9  
Old 05-17-2011, 11:11 AM
valdet's Avatar
valdet valdet is offline
 
Join Date: Feb 2007
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, I don't have base href code.

I added it to headinclude template and I also enabled the RewriteBase on my .htaccess and its still the same.

Does leaving below in my vB 3.x do any harm ?

Code:
<base href="http://www.insurance-forums.net/forum/" /><!--[if IE]></base><![endif]-->
Thanks
Reply With Quote
  #10  
Old 05-17-2011, 12:14 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't think it will do any harm, I just know it's not part of vBulletin by default. If all your forum files are in the same directory (/forums/) you should be OK.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:40 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04382 seconds
  • Memory Usage 2,252KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete