<VirtualHost 127.0.0.1:80>
ServerName test.ru
ServerAlias www.test.ru
ServerAdmin test@bk.ru
DocumentRoot /var/www/test.ru/httpd
ErrorLog logs/test_ru_error_log
LogLevel warn
CustomLog logs/test_ru_assest_log combined
<Directory /var/www/test.ru/httpd>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
DirectoryIndex index.php index.html index.htm
Order allow,deny
allow from all
</Directory>
</VirtualHost>
<VirtualHost 127.0.0.1:80>
ServerName forum.test.ru
ServerAlias www.forum.test.ru
ServerAdmin test@bk.ru
DocumentRoot /var/www/forum.test.ru/httpd
ErrorLog logs/forum_test_ru_error_log
LogLevel warn
CustomLog logs/forum_test_ru_assest_log combined
<Directory /var/www/forum.test.ru/httpd>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
DirectoryIndex index.php index.html index.htm
Order allow,deny
allow from all
</Directory>
</VirtualHost>
<VirtualHost 127.0.0.1:80>
ServerName media.test.ru
ServerAlias www.media.test.ru
ServerAdmin test@bk.ru
DocumentRoot /var/www/media.test.ru/httpd
ErrorLog logs/media_test_ru_error_log
LogLevel warn
CustomLog logs/media_test_ru_assest_log combined
<Directory /var/www/media.test.ru/httpd>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
DirectoryIndex index.php index.html index.htm
Order allow,deny
allow from all
</Directory>
</VirtualHost>
iotop -oka
# 301 --- http://www.test.com/faq.html?faq=13&layout=bob => http://www.test2.com/faqs.html
RewriteCond %{HTTP_HOST} ^www\.test\.com$
RewriteCond %{QUERY_STRING} (^|&)faq=13($|&)
RewriteCond %{QUERY_STRING} (^|&)layout=bob($|&)
RewriteRule ^faq\.html$ http://www.test2.com/faqs.html? [L,R=301]
# 301 --- text/faq.html?faq=20 => helpdesk/kb.php
RewriteCond %{QUERY_STRING} (^|&)faq=20($|&)
RewriteRule ^text/faq\.html$ /helpdesk/kb.php? [L,R=301]
RewriteCond %{HTTP_HOST} ^oldsite\.ru
RewriteCond %{REQUEST_URI} ^!camera/$
RewriteRule ^(.*)$ http://newsite.ru/$1 [R=301,L]
RewriteCond %{REQUEST_URI} ^(.*)/dir1/(.*)$
# если строка содержит /dir1/
RewriteRule ^(.*)$ %1/dir2/%2 [R=301,L]
#Перенаправить все урлы с начинающиеся с dir1 на dir2 с сохранением дальнейшей структуры URL
конд
конд
конд
конд
что делать
RewriteCond %{REQUEST_URI} (скобка первая) ляляля ( скобка вторая)
RewriteRule .* %1%2