Need updated htaccess rules for Windows IIS web.config

Popular automatic website translation tool

Need updated htaccess rules for Windows IIS web.config

Postby mjbradley85 » Tue May 24, 2016 6:03 pm

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:

Code: Select all
   <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>
mjbradley85
 
Posts: 11
Joined: Wed Feb 20, 2013 10:15 pm

Re: Need updated htaccess rules for Windows IIS web.config

Postby mjbradley85 » Tue May 24, 2016 7:07 pm

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! :(

Code: Select all
<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>
mjbradley85
 
Posts: 11
Joined: Wed Feb 20, 2013 10:15 pm

Re: Need updated htaccess rules for Windows IIS web.config

Postby Edvard » Wed May 25, 2016 1:40 am

Hi,

Please use our live chat or contact form to send FTP access and we will try to help you.

Thanks!
Regards,

Edvard Ananyan - 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
Edvard
Site Admin
 
Posts: 4400
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: Need updated htaccess rules for Windows IIS web.config

Postby mjbradley85 » Wed May 25, 2016 5:01 pm

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:

Code: Select all
# 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]
mjbradley85
 
Posts: 11
Joined: Wed Feb 20, 2013 10:15 pm

Re: Need updated htaccess rules for Windows IIS web.config

Postby mjbradley85 » Wed May 25, 2016 9:35 pm

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.
mjbradley85
 
Posts: 11
Joined: Wed Feb 20, 2013 10:15 pm

Re: Need updated htaccess rules for Windows IIS web.config

Postby Edvard » Wed May 25, 2016 9:46 pm

Yes, you can do that. However it is not guaranteed that it will work stable.

At some point you have to upgrade anyways.

Thanks!
Regards,

Edvard Ananyan - 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
Edvard
Site Admin
 
Posts: 4400
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia


  • Related Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests

2GLux