Allow GTranslate to work with Drupal 8

Languages

I finally figured out how to make Google Translate work with the Drupal 8 site! I kept getting a 403 forbidden message whenever I change the language. This is because of the Drupal security directive in place in the .htaccess file.

# Deny access to any other PHP files that do not match the rules above.
# Specifically, disallow autoload.php from being served directly.
RewriteRule "^(.+/.*|autoload)\.php($|/)" - [F]

As a solution, just add a rewrite condition to allow the gtranslate.php to be accessed.

# Allow access to GTranslate
RewriteCond %{REQUEST_URI} !/gtranslate/gtranslate.php$
# Deny access to any other PHP files that do not match the rules above.
# Specifically, disallow autoload.php from being served directly.
RewriteRule "^(.+/.*|autoload)\.php($|/)" - [F]

 

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.