Forum Archive - Need updated htaccess rules for Windows IIS web.config

Need updated htaccess rules for Windows IIS web.config
May 24, 2016 2:03 pm by mjbradley85
Hi, I just switched from gTranslate PRO to the new paid startup plan. I'm in the process of reconfiguring our server, but I can't figure out how to transfer the htaccess rules into my Windows IIS web.config file. Can you please provide me with the new rewrite rules to place in my IIS web.config file? I'm trying to keep the subdirectory structure: http://www.finishlynx.com/es/" rel="nofollow" target="_blank Here is the old web.config code you provided years ago: <rule name="Imported Rule 1" stopProcessing="true"> <match url="^(ht|hy|eu|zh-CN|zh-TW|en|ar|bg|hr|cn|ct|cs|da|et|tl|fi|fr|gl|el|ht|hy|eu|iw|hi|es|nl|id|ja|ca|ko|lt|lv|mt|de|no|pt|ru|ro|sr|sk|sl|sv|th|tr|uk|hu|vi|it|pl|sq)/(ht|hy|eu|zh-CN|zh-TW|en|ar|bg|hr|cn|ct|cs|da|et|tl|fi|fr|gl|el|iw|hi|es|nl|id|ja|ca|ko|lt|lv|mt|de|no|pt|ru|ro|sr|sk|sl|sv|th|tr|uk|hu|vi|it|pl|sq)/(.*)$" ignoreCase="false" /> <action type="Redirect" url="/{R:1}/{R:3}" redirectType="Permanent" /> </rule> <rule name="Imported Rule 2" stopProcessing="true"> <match url="^(ht|hy|eu|zh-CN|zh-TW|en|ar|bg|hr|cn|ct|cs|da|et|tl|fi|fr|gl|el|iw|hi|es|nl|id|ja|ca|ko|lt|lv|mt|de|no|pt|ru|ro|sr|sk|sl|sv|th|tr|uk|hu|vi|it|pl|sq)/(ht|hy|eu|zh-CN|zh-TW|en|ar|bg|hr|cn|ct|cs|da|et|tl|fi|fr|gl|el|iw|hi|es|nl|id|ja|ca|ko|lt|lv|mt|de|no|pt|ru|ro|sr|sk|sl|sv|th|tr|uk|hu|vi|it|pl|sq)$" ignoreCase="false" /> <action type="Redirect" url="/{R:1}/" redirectType="Permanent" /> </rule> <rule name="Imported Rule 3" stopProcessing="true"> <match url="^(ht|hy|eu|zh-CN|zh-TW|en|ar|bg|hr|cn|ct|cs|da|et|tl|fi|fr|gl|el|iw|hi|es|nl|id|ja|ca|ko|lt|lv|mt|de|no|pt|ru|ro|sr|sk|sl|sv|th|tr|uk|hu|vi|it|pl|sq)/(.*)$" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> </conditions> <action type="Rewrite" url="/gtranslate/translate.php?lang={R:1}&amp;url={R:2}" appendQueryString="true" /> </rule> <rule name="Imported Rule 4" stopProcessing="true"> <match url="^(zh-CN|zh-TW|en|ar|bg|hr|cn|ct|cs|da|et|tl|fi|fr|gl|el|iw|hi|es|nl|id|ja|ca|ko|lt|lv|mt|de|no|pt|ru|ro|sr|sk|sl|sv|th|tr|uk|hu|vi|it|pl|sq)$" ignoreCase="false" /> <action type="Rewrite" url="/gtranslate/translate.php?lang={R:1}" appendQueryString="true" /> </rule>
Re: Need updated htaccess rules for Windows IIS web.config
May 24, 2016 3:07 pm by mjbradley85
I tried to input the htaccess code into a web.config rewrite generator. But the code that it output doesn't seem to work. Can you spot any syntax issues? Please help! :( <rule name="rule 1F"> <match url=".*" /> <action type="Rewrite" url="/-" /> </rule> <rule name="rule 2F" stopProcessing="true"> <match url="^(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-CN|zh-TW|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu)/(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-CN|zh-TW|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu)/(.*)$" /> <action type="Rewrite" url="//{R:1}/{R:3}" /> </rule> <rule name="rule 3F" stopProcessing="true"> <match url="^(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-CN|zh-TW|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu)/(.*)$" /> <action type="Rewrite" url="//gtranslate/gtranslate.php?glang={R:1}&amp;gurl={R:2}" appendQueryString="true" /> </rule> <rule name="rule 4F" stopProcessing="true"> <match url="^(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-CN|zh-TW|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu)$" /> <action type="Rewrite" url="//{R:1}/" /> </rule>
Re: Need updated htaccess rules for Windows IIS web.config
May 24, 2016 9:40 pm by Edvard
Hi, Please use our live chat or contact form to send FTP access and we will try to help you. Thanks!
Re: Need updated htaccess rules for Windows IIS web.config
May 25, 2016 1:01 pm by mjbradley85
Our server is full of private company data and I would really prefer not to grant FTP access. Can you please just provide the web.config code? I just need the web.config version of these htaccess rules: # gtranslate config RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteRule ^(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-CN|zh-TW|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu)/(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-CN|zh-TW|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu)/(.*)$ /$1/$3 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-CN|zh-TW|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu)/(.*)$ /gtranslate/gtranslate.php?glang=$1&gurl=$2 [L,QSA] RewriteRule ^(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-CN|zh-TW|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu)$ /$1/ [R=301,L]
Re: Need updated htaccess rules for Windows IIS web.config
May 25, 2016 5:35 pm by mjbradley85
Hi, it says in your Gtranslate PRO end of life announcement that we can continue using gtranslate PRO without support or new translations. Is this the case? If so, I would like to do so. The reason I upgraded is because my translations suddenly stopped working and it said my license was no longer valid. Is it possible to continue using my old cached translations without getting the license error? If for some reason you do not wish to upgrade, then you may continue using it without updates and support from us. Also for new translations you will need to buy Google Translate API key and use it with your Pro license.
Re: Need updated htaccess rules for Windows IIS web.config
May 25, 2016 5:46 pm by Edvard
Yes, you can do that. However it is not guaranteed that it will work stable. At some point you have to upgrade anyways. Thanks!

SIMILAR TOPICS

https configApr 16, 2018 5:54 pmReplies: 1Post by: fxbotmarket
Page not updated?Jan 24, 2018 11:05 pmReplies: 1Post by: smileexcursions
Some bad URLs and high load on website - bad config?Aug 11, 2017 9:18 pmReplies: 3Post by: Ant_Z
Potential threat identified in .htaccessMar 1, 2017 7:30 pmReplies: 3Post by: Hannah
config required for aferry.seJan 30, 2017 3:03 pmReplies: 5Post by: ferryto.com

Try GTranslate with a free 15 day trial