我有的:
- 有两种语言安装:德语和英语
- 语言版本与子文件夹(www.domain.com/de/和www.domain.com/en/)管理
- 机:安装Typo3的4.5.4 / RealUrl
- mod_rewrite的启用一个作品
我想做的事:
- 重定向没有语言的子文件夹请求到德语版
- 例如domain.com/any/test/folder/到domain.com/ 德 /任何/测试/文件夹
我的尝试:
RedirectMatch permanent ^/(?!(?:(?:de|en)/))(.*)$ /de/$1
发生的历史问题:
- 所有请求都是针对domain.com/de/index.php
- 它导致了错误310(净:: ERR_TOO_MANY_REDIRECTS)
- 也许它没有使用TYPO3的htaccess的项目?
我的洞的.htaccess文件:
# Enable URL rewriting
RewriteEngine On
# Change this path, if your TYPO3 installation is located in a subdirectory of the website root.
# RewriteBase /
# Rule for versioned static files, configured through:
# - $TYPO3_CONF_VARS['BE']['versionNumberInFilename']
# - $TYPO3_CONF_VARS['FE']['versionNumberInFilename']
# IMPORTANT: This rule has to be the very first RewriteCond in order to work!
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gzip)$ $1.$3 [L]
# Stop rewrite processing, if we are in the typo3/ directory.
RewriteRule ^(typo3/|t3lib/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
# Redirect http://example.com/typo3 to http://example.com/typo3/index_re.php and stop the rewrite processing.
RewriteRule ^typo3$ typo3/index_re.php [L]
#301 redirection for language mode
RedirectMatch permanent ^/(?!(?:(?:de|en)/))(.*)$ /de/$1
# If the file/symlink/directory does not exist => Redirect to index.php.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
# Main URL rewriting.
RewriteRule .* index.php [L]
所以,我该怎么办?