Forum Archive - sh404 shurl's not working

sh404 shurl's not working
Jul 17, 2012 2:33 pm by jasongt
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
Re: sh404 shurl's not working
Jul 18, 2012 9:30 am by jasongt
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?
Re: sh404 shurl's not working
Jul 19, 2012 7:34 am by Yana
Hi, It recognized as a language code. Please read this topic . Hope this will help you gtranslate-affect-original-mydomain-com-pages-t2065.html#:~:text=recognized%20as
Re: sh404 shurl's not working
Jul 19, 2012 8:47 am by jasongt
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
Re: sh404 shurl's not working
Jul 19, 2012 8:59 am by jasongt
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?
Re: sh404 shurl's not working
Jul 19, 2012 9:44 am by jasongt
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? #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]
Re: sh404 shurl's not working
Jul 19, 2012 9:12 pm by Yana
Hi, Yes, you need to replace [a-z] with the language codes which you want to use .

SIMILAR TOPICS

Drop down is not working???Sep 30, 2018 11:05 amReplies: 1Post by: vijayparmar
Cart stopped workingSep 1, 2018 12:10 pmReplies: 3Post by: willsonjayram
Plugin Not WorkingMar 10, 2018 6:49 pmReplies: 11Post by: wsjiii
Enterprise URLs not workingMay 14, 2018 8:25 pmReplies: 1Post by: dpitfield
Translation link not working after module upgradeNov 28, 2017 11:45 pmReplies: 1Post by: andru

Try GTranslate with a free 15 day trial