[solved] htaccess rewrite breaks javascript
May 27, 2011 11:17 am by [email protected]
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]
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
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 dropdown | Oct 26, 2017 8:26 am | Replies: 3 | Post by: danielesantosubito |
Potential threat identified in .htaccess | Mar 1, 2017 7:30 pm | Replies: 3 | Post by: Hannah |
[SOLVED] NOT WORKING, HELP PLEASE! | Feb 12, 2017 4:53 pm | Replies: 5 | Post by: TSM |
Need help <SOLVED> | Feb 6, 2017 1:48 pm | Replies: 5 | Post by: blaxx |
[solved] edit translations problem | Dec 15, 2011 10:05 pm | Replies: 19 | Post by: slweb2 |