sh404 shurl's not working

Popular automatic website translation tool

sh404 shurl's not working

Postby jasongt » Tue Jul 17, 2012 6:33 pm

Hi, I have noticed that some of my two letter shurl's generated by sh404 are no longer redirecting to the correct page now that I have installed Gtranslate Pro. I am assuming that this is due to Gtranslate also using the 2 letter acronyms, i.e. es/fr/it etc

How can this conflict be managed so my short urls are still preserved?

I have also noticed that if I enter a two letter short url into the browser I sometimes get this error scrolling

Warning: file_put_contents(cache/wh/77295c7d814e7397c55f64ec06313984) [function.file-put-contents]: failed to open stream: No such file or directory in /homepages/30/d**********/htdocs/ypjoomla/gtranslate/translate.php on line 305
jasongt
 
Posts: 11
Joined: Mon Jul 16, 2012 7:36 pm

Re: sh404 shurl's not working

Postby jasongt » Wed Jul 18, 2012 1:30 pm

I have now edited sh404sef shurl blacklist and added in all the 2 letter country codes so it will not create any that are languages in GTranslate. This partially fixes the conflict, however, if I add a two letter acronym to the end of a url i.e mysite.com/al then I get the error listed above.

How do I resolve this error?
jasongt
 
Posts: 11
Joined: Mon Jul 16, 2012 7:36 pm

Re: sh404 shurl's not working

Postby Yana » Thu Jul 19, 2012 11:34 am

Hi,
It recognized as a language code. Please read this topic . Hope this will help you
gtranslate-affect-original-mydomain-com-pages-t2065.html?hilit=recognized%20as#p7746
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: 4133
Joined: Thu Jan 12, 2012 6:21 pm

Re: sh404 shurl's not working

Postby jasongt » Thu Jul 19, 2012 12:47 pm

This doesn't work.

To be clear. When I enter mysite.com/al I get this error scrolling up the screen:

Warning: file_put_contents(cache/wh/77295c7d814e7397c55f64ec06313984) [function.file-put-contents]: failed to open stream: No such file or directory in /homepages/30/d**********/htdocs/ypjoomla/gtranslate/translate.php on line 305

the /al is not a language nor is it an shurl generated by sh404sef

I don't want my visitors to be able to enter a two letter acronym by mistake and crash the site!

It looks like GTranslate doesn't know what to do when a two letter code is entered that it doesn't recognise.

The .htaccess code in your link appears to solve a Wordpress issue. my site is running Joomla 1.5
jasongt
 
Posts: 11
Joined: Mon Jul 16, 2012 7:36 pm

Re: sh404 shurl's not working

Postby jasongt » Thu Jul 19, 2012 12:59 pm

I think your .htaccess rules are redirecting any two letter code to gtranslate and gtranslate doesn't know how to handle two letter codes that are not languages.

I assume the only way to fix this is specify only the required two letter language codes (rather than all) in the .htaccess or amend gtranslate?
jasongt
 
Posts: 11
Joined: Mon Jul 16, 2012 7:36 pm

Re: sh404 shurl's not working

Postby jasongt » Thu Jul 19, 2012 1:44 pm

O.k, I have fixed it myself by editing the .htaccess and specifying the exact languages you support.

Here is my revised code. Do you see any issues with this or is there a smarter way to do this?

Code: Select all
#gtranslate config
#next 2 lines are the original ones but caused issue if 2 letter code was not valid
#RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/([a-z]{2}|zh-CN|zh-TW)/(.*)$ /$1/$3 [R=301,L]
#RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/([a-z]{2}|zh-CN|zh-TW)$ /$1/ [R=301,L]
RewriteRule ^(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|en|et|tl|fi|fr|gl|ka|de|el|ht|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|th|tr|uk|ur|vi|cy|yi)/(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|en|et|tl|fi|fr|gl|ka|de|el|ht|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|th|tr|uk|ur|vi|cy|yi)/(.*)$ /$1/$3 [R=301,L]
RewriteRule ^(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|en|et|tl|fi|fr|gl|ka|de|el|ht|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|th|tr|uk|ur|vi|cy|yi)/(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|en|et|tl|fi|fr|gl|ka|de|el|ht|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|th|tr|uk|ur|vi|cy|yi)$ /$1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
#next 2 lines are the original ones but caused issue if 2 letter code was not valid
#RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/(.*)$ /gtranslate/translate.php?lang=$1&url=$2 [L,QSA]
#RewriteRule ^([a-z]{2}|zh-CN|zh-TW)$ /gtranslate/translate.php?lang=$1 [L,QSA]
RewriteRule ^(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|en|et|tl|fi|fr|gl|ka|de|el|ht|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|th|tr|uk|ur|vi|cy|yi)/(.*)$ /gtranslate/translate.php?lang=$1&url=$2 [L,QSA]
RewriteRule ^(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|zh-TW|hr|cs|da|nl|en|et|tl|fi|fr|gl|ka|de|el|ht|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|th|tr|uk|ur|vi|cy|yi)$ /gtranslate/translate.php?lang=$1 [L,QSA]
jasongt
 
Posts: 11
Joined: Mon Jul 16, 2012 7:36 pm

Re: sh404 shurl's not working

Postby Yana » Fri Jul 20, 2012 1:12 am

Hi,

Yes, you need to replace [a-z] with the language codes which you want to use .
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: 4133
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