共有サーバーでの WOVN.php 導入時に、500 番エラーが表示される

事象

WOVN.php を下記の条件で導入した場合、HTTP ステータスコード:500 番の Internal Server Error が出力されることがあります。

条件

  • PHP ライブラリで WOVN の導入を行っている

  • Rewrite 方式により、.htaccess を使って wovn_index.php へリダイレクトさせている

  • ホスティング事業者の共有サーバーを利用して WOVN の導入を行っている

原因

共有サーバーでは、利用しているユーザー全ての Web サービスが一つの Web サーバーに共存しています。共有サーバーが裏側で管理する URI によっては、WOVN.php で使うリダイレクトと不整合を起こす場合があります。

解決方法

.htaccess ファイルに、RewriteBase / を追記してください。

RewriteEngine Onの直下に記述することを推奨しております。

サンプル

<IfModule mod_rewrite.c>
 RewriteEngine On
# 共有サーバー利用時はこのベースURIを変更します
 RewriteBase /

# パス形式を使う場合は、言語コードを予め削除します
 RewriteRule ^/?(?:ar|eu|bn|bg|ca|zh-CHS|zh-CHT|da|nl|en|fi|fr|gl|de|el|he|hu|id|it|ja|ko|lv|ms|my|ne|no|fa|pl|pt|ru|es|sw|sv|tl|th|hi|tr|uk|vi)($|/.*$) $1 [L]

# CGIファイルはwovn_index.phpへ中継させません
 #RewriteCond %{THE_REQUEST} \.cgi
 #RewriteRule .? - [L]

# ここにお客様の処理が入ります〜〜〜〜〜〜〜〜〜
#
#
#
#
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# Intercept only static content: html and htm urls
 # Warning: do not remove this line or other content could be loaded
 RewriteCond %{REQUEST_URI} !(^/phpinfo.php)
 RewriteCond %{REQUEST_URI} /$ [OR]
 RewriteCond %{REQUEST_URI} \.(html|htm|shtml|php|php3|phtml)
 # Use the wovn_index.php to handle static pages
 RewriteCond %{REQUEST_URI} !(^wovn_index.php)
 RewriteRule .? wovn_index.php [L]
</IfModule>