Подскажите как сделать 301 редирект на htaccess.
На HostCms находиться два сайта
www.site1.ua, www.site2.ua под разными доменами, сейчас htaccess содержит следующий код:
AuthName "Admin"
AuthType Basic
AuthUserFile /var/www/site1/.htpasswd
#require valid-user
<IfModule mod_php4.c>
php_flag magic_quotes_gpc off
php_flag magic_quotes_runtime off
php_flag register_globals off
</IfModule>
<IfModule mod_php5.c>
php_flag magic_quotes_gpc off
php_flag magic_quotes_runtime off
php_flag register_globals off
</IfModule>
Options +FollowSymlinks
DirectoryIndex index.php index.htm index.html
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{HTTP_COOKIE} !^.*PHPSESSID=.*$
RewriteCond %{DOCUMENT_ROOT}/cache_html/%{HTTP_HOST}%{REQUEST_URI}%{QUERY_STRING}index.html -f
RewriteRule ^(.*)$ /cache_html/%{HTTP_HOST}%{REQUEST_URI}%{QUERY_STRING}index.html
Мне нужно сделать следующие 301 редиректы:
1.
http://site2.ua/ru/ на
http://site2.ua/
2.
http://site2.ua/index.php на
http://site2.ua/
3.
http://www.site2.ua/ на
http://site2.ua/
Какие данные нужно добавить в файл htaccess чтобы оба сайта корректно работали с нужными 301 редиректами?