リダイレクト(Redirect) : ドメイン・サーバー
Apacheのhtaccessを使ったリダイレクト(Redirect)の覚書。
例1
http://www.exsample.com/index.htmlのアクセスをhttp://www.exsample.com/index.phpへリダイレクトする。
htaccessファイルに下記ように記述する。
Redirect permanent /index.html http://www.exsample.com/index.php
追記 2011.06.02 DirectoryIndexを使うほうが一般的。
DirectoryIndex index.html index.php
例2
http://www.exsample.com/sample/index.htmlのアクセスをhttp://www.exsample.com/sample/index.phpへリダイレクトする。
Redirect permanent /sample/index.html http://www.exsample.com/sample/index.php
例3
あるディレクトリ以下を別のアドレスへリダイレクトする。
http://www.exsample.com/sample/以下のアクセスをhttp://www.exsample.com/sample2/へリダイレクトする。
Redirect permanent /sample/ http://wwww.example.com/sample2/
» HTTPリダイレクト Others htaccess
» htaccessでリダイレクト機能を利用する方法 | BULANCO BLOG
関連記事
- 関連記事は見つかりませんでした。
検索ボックスからの検索もお試しください。
コメント
コメントはまだありません。
コメントの投稿
改行と段落タグは自動で挿入されます。
メールアドレスは表示されません。
トラックバックURL
http://www.findxfine.com/server/apache/1118.html/trackback