質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
.htaccess

Apacheウェブサーバーにおいて、ディレクトリ単位で設置及び設定を行う設定ファイルを指します。

Q&A

0回答

1044閲覧

特定のディレクトリにルートの.htaccessを継承させない

Mikk

総合スコア0

.htaccess

Apacheウェブサーバーにおいて、ディレクトリ単位で設置及び設定を行う設定ファイルを指します。

0グッド

0クリップ

投稿2021/01/10 01:54

前提・実現したいこと

初期、ルート直下にページを公開していました。
後、リニューアルをし、独自ドメインを取得後、ルート下位に/examlple/ディレクトリを作成、
ルートのページを/examlple/以下のページにリダイレクトをかけていました。

現在、独自ドメインを新たに取得し、/newsite/に割当、ページを公開したのですが、
500エラーがでて、表示されません。

サーバー会社に問い合わせたところルートの.htaccessを削除しろとのこと。
それを削除すると、リダイレクト消えてしまうので、/newsite/ディレクトリのみ、ルートの.htaccessを継承したくありません。

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !(^/bbb/)
RewriteRule ^$ http:www.aaa.com [R=301,L]
を追記しても、全く動じません。
書き方が間違っているようですが、
ご指南いただけますと幸いです。

発生している問題・エラーメッセージ

500エラー

該当のソースコード

AddHandler php5.3-script .htm .html

RewriteEngine on
RewriteCond %{HTTP_HOST} ^root.web.jp
RewriteRule ^(.*) https://example.com/$1 [R=301,L]
Redirect 301 http://root.web.jp/ https://example.com/

Redirect 301 /sp/index.html https://example.com/

Redirect 301 /index01.html https://example.com/index01.php

Redirect 301 /index02.html https://example.com/index02.php

Redirect 301 /index03.html https://example.com/index03.php

Redirect 301 /index04.html https://example.com/index04.php

Redirect 301 http://root.web.jp/blog/ https://example.com/blog/

Redirect 301 /index05.html https://example.com/index05.php

Redirect 301 /index06.html https://example.com/index06.php

Redirect 301 /index07.html https://example.com/index07.php

試したこと

AddHandler php5.3-script .htm .html

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !(^/bbb/)
RewriteRule ^$ http:www.aaa.com [R=301,L]

RewriteEngine on
RewriteCond %{HTTP_HOST} ^root.web.jp
RewriteRule ^(.*) https://example.com/$1 [R=301,L]
Redirect 301 http://root.web.jp/ https://example.com/

Redirect 301 /sp/index.html https://example.com/

Redirect 301 /index01.html https://example.com/index01.php

Redirect 301 /index02.html https://example.com/index02.php

Redirect 301 /index03.html https://example.com/index03.php

Redirect 301 /index04.html https://example.com/index04.php

Redirect 301 http://root.web.jp/blog/ https://example.com/blog/

Redirect 301 /index05.html https://example.com/index05.php

Redirect 301 /index06.html https://example.com/index06.php

Redirect 301 /index07.html https://example.com/index07.php

補足情報(FW/ツールのバージョンなど)

ここにより詳細な情報を記載してください。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

otn

2021/01/10 02:51

> 500エラーがでて、表示されません。 エラーログの内容を書きましょう。
Mikk

2021/01/10 02:54

ありがとうございます。 エラーログとは、500 Internal Server Errorというものでしょうか。
otn

2021/01/10 02:56

いいえ。エラーログファイルの中身です。
Mikk

2021/01/10 02:57

申し訳ありません、どちらに表示されるか不明です。 500 Internal Server Errorと表示されているのは、WEBページです。
otn

2021/01/10 04:22

> 申し訳ありません、どちらに表示されるか不明です。 探しましょう。 > 500 Internal Server Errorと表示されているのは、WEBページです。 分かっています。
Mikk

2021/01/10 04:28

ご返答ありがとうざいます。どのように探すのかが不明なのです。
otn

2021/01/10 04:31

考えるか調べるかしましょう。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問