リダイレクト(Redirect) : ドメイン・サーバー

投稿日 : 2009年4月1日 | 更新日 : 2011年10月26日 前のページへ戻る

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

Apache,WordPress | 固定リンク | Comments (0)

関連記事

    関連記事は見つかりませんでした。
    検索ボックスからの検索もお試しください。

このページの上へ移動

コメント

コメントはまだありません。

コメントの投稿

改行と段落タグは自動で挿入されます。
メールアドレスは表示されません。

 

 

 


トラックバックURL

http://www.findxfine.com/server/apache/1118.html/trackback

このページの上へ