Forum Archive - [solved] htaccess rewrite breaks javascript

[solved] htaccess rewrite breaks javascript
May 27, 2011 11:17 am by [email protected]
Hi I'm trying to install gtranslate, everything is fine until I add the line RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/(.*)$ /gtranslate/translate.php?lang=$1&url=$2 [L,QSA] to my htaccess, which results in 404 errors on the URLs to the javascript files. The 404 page has <!-- generated by GTranslate Pro v3.1415 on Fri, 27 May 2011 12:10:50 +0100 visit http://edo.webmaster.am/gtranslate --> so it is definitely a result of gtranslate. any help greatly appreciated Dave
Re: htaccess rewrite breaks javascript
May 27, 2011 11:24 am by [email protected]
I'm so stupid - worked it out. My javascript files were in a folder 'mysite/js/' the 2 letter folder was obviously being treated as a country code... So, just in case this is a problem for anyone else - don't use '/js/' for you javascript folder!
Re: [solved] htaccess rewrite breaks javascript
May 31, 2011 7:52 am by Edvard
You can also make it to exclude js folder by this rewrite condition before every gtranslate rewrite rule: RewriteCond %{REQUEST_URI} !^/js

SIMILAR TOPICS

[SOLVED]double dropdownOct 26, 2017 8:26 amReplies: 3Post by: danielesantosubito
Potential threat identified in .htaccessMar 1, 2017 7:30 pmReplies: 3Post by: Hannah
[SOLVED] NOT WORKING, HELP PLEASE!Feb 12, 2017 4:53 pmReplies: 5Post by: TSM
Need help <SOLVED>Feb 6, 2017 1:48 pmReplies: 5Post by: blaxx
[solved] edit translations problemDec 15, 2011 10:05 pmReplies: 19Post by: slweb2

Try GTranslate with a free 15 day trial