diff --git a/globalredirect.module b/globalredirect.module index 961c1ce..a213222 100644 --- a/globalredirect.module +++ b/globalredirect.module @@ -215,8 +215,14 @@ function globalredirect_init() { // Compare the request to the alias. This also works as a 'deslashing' // agent. If we have a language prefix then prefix the alias if ($request_path != $prefix . $alias) { + $redirect = FALSE; + $noalias_request_path = str_replace($alias, '', $request_path); + // If we have a prefix language, and an alias, don't go into redirect loop. + if ($langcode && empty($noalias_request_path)) { + $redirect = TRUE; + } // If it's not just a slash or user has deslash on, redirect - if (str_replace($prefix . $alias, '', $request_path) != '/' || $settings['deslash']) { + if (!$redirect && (str_replace($prefix . $alias, '', $request_path) != '/' || $settings['deslash'])) { globalredirect_goto($alias, $options); } }