![Languages](/sites/default/files/styles/large/public/2020-05/photo-1558443957-d056622df610.jpeg?itok=vtBkUmMd)
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