リダイレクトのやり方(.htaccess、apache、php、html)
.htaccessでリダイレクト
例
http://hogehoge.com/aaa にアクセスしたら、http://google.comにリダイレクト。
スラッシュのつけすぎとかに注意。
Redirect permanent /aaa http://google.com/
rewriteのLoadModuleがhttp.confにない場合は書いてからじゃないと動かない。
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ http://google.co.jp/$1 [R,L]
apacheでリダイレクト
基本はhtaccessと同じ。
PHPでリダイレクト
index.phpを設置して下記を記載。
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.hogehoge.com");
exit();
?>
HTMLでリダイレクト
メタタグにこうかく
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://XXXXX" />
分かりやすそうなサイトみっけ