View Full Version : Solved Forum links = failure
I have a few forums that serve as links: for example, one of my forums links to pentaxforums.com/lensreviews/.
When translated to a foreign language, the link is rewritten with the language in the URL, i.e. to pentaxforums.com/sv/lensreviews/, which obviously returns a failure. Is there a fix for this? I'd rather avoid the 301 htaccess route.
Please be calm. We know well this situation - you just need to configure vBET appropriately :)
Please set in vBET options your forum directory and make sure you have appropriate .htaccess rules (directory need to be added as described in manual).
I'm not sure what you mean. AFAIK everything is configured properly per the manual.
Go to Admin CP -> vBET -> Main and set 'Forum directory'
That's already set. I don't think you understand my problem.
This only applies to forums that act as links. If a forum links to a folder on my website that's outside of the forum directory, the /lang/ is still added in between, thus resulting in a 404 error. Obviously that area of the site cannot be translated using vBET.
OK - sorry for confusion. I really didn't understood the issue.
As I can see your forum pages are translated well.
Now area outside forum directory. As you can see on this forum vBET supports translation of area outside forum directory - of course those pages have to be generated by vBulletin. So if your areas outside forum directory are also generated by vBulletin you are able to translate it.
What is needed:
1. Separate .htaccess file in directory where are pages to translate (you will find appropriate rules in do-not-upload directory)
2. All URL's on pages translated outside forum directory must be absolute (starting with http), otherwise you can have issues with translation tracking.
3. If those pages are in some other subdirectory (not in the domain root) then you will have to configure 'Keep Directories' in AdminCP->vBET->Main
In case of any future questions - just ask :)
Ok- thanks! I will try this, but I have one more question.
Is it possible to just disable translation for those areas and have the link properly point to the url? I have a hunch that the section in question won't translate as it isn't a vBulletin plugin (it only queries the DB separately).
moman - I have a custom addon that translated fine. I added it to "Keep Directories"
I'll try this with the htaccess file, but five bucks says it won't work. The section in question doesn't necessarily need translation at all, as it is highly technical, so I just want to get around the bug in vBET that translates external links that aren't necessarily part of vB.
I applied the htaccess rules as stated in the readme.
RewriteRule ^/?(af|sq|ar|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|de|el|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|zh-TW|th|tr|uk|vi|cy|yi)/$ index.php?language=$1&vbet_outside=true [L,QSA]
RewriteRule ^/?(af|sq|ar|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|de|el|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|zh-TW|th|tr|uk|vi|cy|yi)/(.*)?$ $2?language=$1&vbet_outside=true [L,QSA]
RewriteCond %{QUERY_STRING} !vbet_outside=true
RewriteRule ^(.*)$ $1?vbet_outside=true [L,QSA]
While Page Not Found - PentaxForums.com (http://www.pentaxforums.com/lensreviews/pl/) did not return a 404, the page was not translated (obviously, since there's no vbet init there), and, furthermore, all links from that page returned the 404 as vBSEO CRR's stopped working.
Therefore, let's just take the simpler solution and save ourselves a headache:
How to I prevent forum links from translating?
Currently, Pentax Lens Review and Specification Database - Main Index (http://www.pentaxforums.com/lensreviews/) (a link) is rewritten to http://www.pentaxforums.com/forums/pl/lensreviews/ (404).
I want the link to remain unchanged.
Ok- thanks! I will try this, but I have one more question.
Is it possible to just disable translation for those areas and have the link properly point to the url? I have a hunch that the section in question won't translate as it isn't a vBulletin plugin (it only queries the DB separately).
It doesn't have to be vB plugin - it just have to be page generated by vB. See on our main page, Download or Buy Now sections - those are not made by any plugin, but are generated by vB. So have appropriate template includes global.php and so on. So such pages can be easily translated in the way I described you.
I'll try this with the htaccess file, but five bucks says it won't work. The section in question doesn't necessarily need translation at all, as it is highly technical, so I just want to get around the bug in vBET that translates external links that aren't necessarily part of vB.
I checked your site. It is working fine - just go to your forum, put some translation and see that tracking is not added to lensreviews...
I applied the htaccess rules as stated in the readme.
RewriteRule ^/?(af|sq|ar|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|de|el|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|zh-TW|th|tr|uk|vi|cy|yi)/$ index.php?language=$1&vbet_outside=true [L,QSA]
RewriteRule ^/?(af|sq|ar|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|de|el|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|zh-TW|th|tr|uk|vi|cy|yi)/(.*)?$ $2?language=$1&vbet_outside=true [L,QSA]
RewriteCond %{QUERY_STRING} !vbet_outside=true
RewriteRule ^(.*)$ $1?vbet_outside=true [L,QSA]
While Page Not Found - PentaxForums.com (http://www.pentaxforums.com/lensreviews/pl/) did not return a 404, the page was not translated (obviously, since there's no vbet init there), and, furthermore, all links from that page returned the 404 as vBSEO CRR's stopped working.
Therefore, let's just take the simpler solution and save ourselves a headache:
How to I prevent forum links from translating?
Currently, Pentax Lens Review and Specification Database - Main Index (http://www.pentaxforums.com/lensreviews/) (a link) is rewritten to http://www.pentaxforums.com/forums/pl/lensreviews/ (404).
I want the link to remain unchanged.
I clearly wrote that site have to be generated by vBulletin to be able to translate it.
Also - I do not see what you are writing about. I was there and link to lensreviews is not changed. Please give me exact link to page where I can see this broken link.
Please give me exact link to page where I can see this broken link.
Go to PentaxForums.com - Pentax Photography Forum (http://www.pentaxforums.com/forums/pl/) and click on Obiektyw Pentax Specyfikacja i weryfikacja danych (http://www.pentaxforums.com/forums/pl/forumdisplay.php?f=35) (it's in the 4th category). You will get a 404.
However, this same link is in the navbar (first entry under the 'Reviews' button) and you do NOT get a 404.
Thanks for your help. I still think we're not on the same page as far as what exactly the problem is, so feel free to let me know if you need further explanation. One more time, though, the problem is that
mysite.com / lensreviews / is rewritten to mysite.com / forums / pl / lensreviews when it goes through a forum link.
I put spaces so that the URL isn't parsed.
I suppose a quick fix to this would be to use vBSEO's "Replace 'Forum Links' with direct links to target URLs". However, as I use hit tracking for my external links, doing so would break that system.
Thus, in accordance with my post above, let's find the correct solution to this.
Go to PentaxForums.com - Pentax Photography Forum (http://www.pentaxforums.com/forums/pl/) and click on Obiektyw Pentax Specyfikacja i weryfikacja danych (http://www.pentaxforums.com/forums/pl/forumdisplay.php?f=35) (it's in the 4th category). You will get a 404.
However, this same link is in the navbar (first entry under the 'Reviews' button) and you do NOT get a 404.
Thanks for your help. I still think we're not on the same page as far as what exactly the problem is, so feel free to let me know if you need further explanation. One more time, though, the problem is that
mysite.com / lensreviews / is rewritten to mysite.com / forums / pl / lensreviews when it goes through a forum link.
I put spaces so that the URL isn't parsed.
Now I see it. Those 2 links which you are writing about are not same. One is exact - 2nd have redirections and the issue is right here.
This with redirections goes by:
Original:
http://www.pentaxforums.com/forums/pl/forumdisplay.php?f=35
Then some redirection (not vBET - probably vBSEO or .htaccess):
http://www.pentaxforums.com/forums/pentax-lens-review-specification-database/
And next one is by vBET (added language):
http://www.pentaxforums.com/forums/pl/pentax-lens-review-specification-database/
Then we have next redirection (not vBET - probably vBSEO or .htaccess):
http://www.pentaxforums.com/lensreviews/index.php
And one more time vBET is adding language:
http://www.pentaxforums.com/forums/pl/lensreviews/
So here vBET is adding language because you start as link to forum and you have translation tracking on. Then you made 2 redirections and each time vBET is adding translation tracking.
Quick fix for you below (not tested - so made copy of file and let us know does it work). Also - you should reconfigure your forum to go where you want in first redirection if it is possible.
Quick fix. Open file vbenterprisetranslator_seo.php, find line:
if (isset($_COOKIE['vbet_language']) && !isset($_GET['language']) && false === strpos($_SERVER['REQUEST_URI'],'external.php')) {
and replace it by:
if (isset($_COOKIE['vbet_language']) && !isset($_GET['language']) && false === strpos($_SERVER['REQUEST_URI'],'external.php') && false === strpos($_SERVER['REQUEST_URI'],'lensreviews/index.php')) {
Also we will look for some better solution included in vBET. At this moment vBET is only checking original URL - we didn't thought about such situation as yours. I reopen this issue. Will be closed when official solution will be included in vBET :)
Thank you! I modified the code slightly, but it did work. Initially I had to put 'pentax-lens-review-specification-database' for the strpos, but I further changed it to '-review' as I also have PentaxForums.com Third-Party Pentax Lens Review Database - Main Index (http://www.pentaxforums.com/userreviews/) that was being redirected in error.
if (isset($_COOKIE['vbet_language']) && !isset($_GET['language']) && false === strpos($_SERVER['REQUEST_URI'],'external.php') && false === strpos($_SERVER['REQUEST_URI'],'-review-')) {
So now both /lensreviews/ and /userreviews/ is being redirected properly.
Thanks again!
Thank you! I modified the code slightly, but it did work. Initially I had to put 'pentax-lens-review-specification-database' for the strpos, but I further changed it to '-review' as I also have PentaxForums.com Third-Party Pentax Lens Review Database - Main Index (http://www.pentaxforums.com/userreviews/) that was being redirected in error.
if (isset($_COOKIE['vbet_language']) && !isset($_GET['language']) && false === strpos($_SERVER['REQUEST_URI'],'external.php') && false === strpos($_SERVER['REQUEST_URI'],'-review-')) {
So now both /lensreviews/ and /userreviews/ is being redirected properly.
Thanks again!
3.3.0 has additional parameter 'Ignore URLs' - it will keep chosen URLs out of translation tracking. Please check it :)
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.