- /hoge, /hoge/,/hoge/contact/, /hogeiQfafd?user=55等を『https://example.net/hoge』にリダイレクト
もくじ
/etc/httpd/conf.d/www.sample.com.conf
<VirtualHost *:80> DocumentRoot /var/www/vhosts/www.sample.com/httpdocs/ ServerName www.sample.com ServerAlias sample.com ErrorLog logs/www.sample.com-error.log CustomLog logs/www.sample.com-access.log elb-customlog env=!nolog <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^/hoge(.*)$ https://example.net/hoge [R,L] </IfModule> <Directory "/var/www/vhosts/www.sample.com/httpdocs/"> # 2.2系 #AllowOverride All #Order allow,deny #Allow from all # 2.4系対策 AllowOverride All Require all granted </Directory> </VirtualHost>