[Solved]Broken File Download Links

Popular automatic website translation tool

[Solved]Broken File Download Links

Postby mwangner » Fri Jun 08, 2012 9:49 pm

I am using Gtranslate Pro. It works very well for the website, but it is breaking links for downloadable files.

For instance:

http://www.aventuracctv.com/download/sp ... Series.pdf

When browsing the spanish version of our website that link looks like this instead:

http://www.aventuracctv.com/es/download ... Series.pdf

Except it doesn't work (because there is no file there). I tried adding class="notranslate" to the <a href> statement but that didn't prevent gtranslate pro from rewriting the link. How can I solve this?

Thanks!
mwangner
 
Posts: 14
Joined: Fri Jan 20, 2012 11:06 pm

Re: Broken File Download Links

Postby Yana » Sat Jun 09, 2012 1:03 am

Hi,
You can write a rule in your .htaccess to redirect links to the original language. Here is an example
RewriteRule ^([a-z]{2})/download/(.*) /download/$2 [R=301,L]
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4135
Joined: Thu Jan 12, 2012 6:21 pm

Re: Broken File Download Links

Postby mwangner » Mon Jun 11, 2012 6:55 pm

There is no way to do this in the HTML or in the gtranslate code files? I am running on IIS 6.0 with a third-party redirect which is very difficult to understand (took us weeks to figure out how to do the gtranslate language redirects).
mwangner
 
Posts: 14
Joined: Fri Jan 20, 2012 11:06 pm

Re: Broken File Download Links

Postby Yana » Mon Jun 11, 2012 7:56 pm

Hi,
You can convert it for IIS web.config.
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4135
Joined: Thu Jan 12, 2012 6:21 pm

Re: Broken File Download Links

Postby mwangner » Mon Jun 11, 2012 10:23 pm

What would the code be for web.config?
mwangner
 
Posts: 14
Joined: Fri Jan 20, 2012 11:06 pm

Re: Broken File Download Links

Postby Edvard » Tue Jun 12, 2012 2:43 am

Can you please send the redirect rules you have created for GTranslate, so we can write the necessary code for you?
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4185
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Broken File Download Links

Postby mwangner » Wed Jun 13, 2012 6:05 pm

Absolutely, this is what I have now:

<rewrite url="^(/.+(\.gif|\.png|\.php|\.swf|\.dwg|\.jpg|\.jad|\.cod|\.flv|\.mp4|\.xml|\.eps|\.css|\.html|\.ico|\.pdf|\.rtf|\.doc|\.css|\.zip|\.js)(\?.+)?)$" to="$1" processing="stop" />
<rewrite url="^/(af|ar|az|be|bg|bn|ca|cs|cy|da|de|el|en|es|at|eu|fa|fi|fr|ga|gl|gu|hi|hr|ht|hu|hy|id|is|it|iw|ja|ka|kn|ko|lt|lv|mk|ms|mt|nl|no|pl|pt|ro|ru|sk|sl|sq|sr|sv|sw|ta|te|th|tl|tr|uk|ur|vi|yi|zh-CN|zh-TW)?/(.*)$" to="/gtranslate/translate.php?lang=$1&amp;url=$2" processing="stop" />
<if url="^(.*)/(\?.+)?$">
<rewrite exists="$1/default.aspx" to="$1/default.aspx$2" />
<rewrite exists="$1/default.asp" to="$1/default.asp$2" />
<rewrite exists="$1/index.asp" to="$1/index.asp$2" />
<rewrite exists="$1/index.php" to="$1/index.php$2" />
</if>
<unless exists="^(.+)$">
<rewrite url="^/(.+)/(.+)/" to="~/product/list.asp?subcatename=$1&amp;catname=$2" processing="stop" />
<rewrite url="^/(.+)/(\?(.+))?$" to="~/product/default.asp?catname=$1" processing="stop" />
</unless>
mwangner
 
Posts: 14
Joined: Fri Jan 20, 2012 11:06 pm

Re: Broken File Download Links

Postby mwangner » Mon Jun 18, 2012 8:17 pm

Edvard, do you have the code I would need to do this yet?
mwangner
 
Posts: 14
Joined: Fri Jan 20, 2012 11:06 pm

Re: Broken File Download Links

Postby Edvard » Tue Jun 19, 2012 5:01 pm

You need to add this before <rewrite url="^/(af|ar|az|... line:

<redirect url="^/(af|ar|az|be|bg|bn|ca|cs|cy|da|de|el|en|es|at|eu|fa|fi|fr|ga|gl|gu|hi|hr|ht|hu|hy|id|is|it|iw|ja|ka|kn|ko|lt|lv|mk|ms|mt|nl|no|pl|pt|ro|ru|sk|sl|sq|sr|sv|sw|ta|te|th|tl|tr|uk|ur|vi|yi|zh-CN|zh-TW)?/download/(.*)$" to="/download/$2" />

For more info about redirect tag please check this: http://urlrewriter.net/index.php/suppor ... s/redirect
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4185
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Broken File Download Links

Postby mwangner » Thu Jun 21, 2012 6:57 pm

This works very well, thank you!
mwangner
 
Posts: 14
Joined: Fri Jan 20, 2012 11:06 pm

Re: [Solved]Broken File Download Links

Postby jasons » Fri Mar 06, 2015 7:44 pm

Hello - I have run into this same problem as well. Could someone send me the full code I need to place in the .htaccess file to get my PDF links to work?
jasons
 
Posts: 13
Joined: Wed Oct 22, 2014 10:35 pm

Re: [Solved]Broken File Download Links

Postby Yana » Sat Mar 07, 2015 12:07 am

Hi,
Please send me the pdf file link example.
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4135
Joined: Thu Jan 12, 2012 6:21 pm

Re: [Solved]Broken File Download Links

Postby jasons » Sat Mar 07, 2015 1:49 am

Yana - Here is the PDF link in English
*removed link*

Here it is in French
*removed link*

It works in English but not in any of the other languages. I noticed that it does this for all PDF's on my site.
I am running the Pro version of GTranslate.
Last edited by jasons on Tue Mar 10, 2015 8:40 pm, edited 1 time in total.
jasons
 
Posts: 13
Joined: Wed Oct 22, 2014 10:35 pm

Re: [Solved]Broken File Download Links

Postby Yana » Sun Mar 08, 2015 12:31 am

Hi,
Here is the rule:

RewriteRule ^([a-z]{2})/images/agenda/(.*) /images/agenda/$2 [R=301,L]
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4135
Joined: Thu Jan 12, 2012 6:21 pm

Re: [Solved]Broken File Download Links

Postby jasons » Tue Mar 10, 2015 5:47 am

Yana - Should this be placed in the .htaccess file?
jasons
 
Posts: 13
Joined: Wed Oct 22, 2014 10:35 pm

Re: [Solved]Broken File Download Links

Postby Yana » Tue Mar 10, 2015 6:53 pm

Hi,
Yes , you should put it after RewriteEngine On .
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4135
Joined: Thu Jan 12, 2012 6:21 pm

Re: [Solved]Broken File Download Links

Postby jasons » Tue Mar 10, 2015 8:40 pm

That worked, thanks Yana!
jasons
 
Posts: 13
Joined: Wed Oct 22, 2014 10:35 pm

Re: [Solved]Broken File Download Links

Postby Yana » Fri Mar 13, 2015 4:22 pm

Good to hear that! You are welcome.
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4135
Joined: Thu Jan 12, 2012 6:21 pm


  • Related Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests

2GLux