WEB・アプリ開発

WordPressをサブディレクトリからサブドメインへ移行で起きた問題

ローカル(Mac)で複数のWordPressサイトの開発を行っており、今まではサブディレクトリーで運用していました。とあるWordpressテーマはサブディレクトリーだと都合が良くないので、サブドメインで運用することにしたところ、下のようなエラーが発生しました。

Internal Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at you@example.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Apacheのログには下のようなエラーが吐かれていました。

[Thu Nov 24 20:50:07.733398 2016] [core:error] [pid 49982] [client 127.0.0.1:49565] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use ‘LimitInternalRecursion’ to increase the limit if necessary. Use ‘LogLevel debug’ to get a backtrace., referer: http://med-eng.localhost/dmm-kuchikomi/

WordPressアドレスやサイトアドレスはしっかりサブドメインに修正していましたが、一つ見落としていたところがありました。

それはWordPressインストール時に生成された .htaccessでした。この中に、サブディレクトリーの /med-eng/が残っていました。


これを以下のように修正したところエラーは発生しなくなりました。


ちなみに、移行時に参考にしたサイトは以下です。