No input file specified.と表示され、翻訳済みページに遷移できない

事象

ライブラリ方式のサイトにおいて、翻訳済みページに遷移できない。
「No input file specified.」と表示される。

原因

導入方式が以下の場合、設定ファイルに必要なルールが追記されていない可能性があります。

  • ライブラリ方式
  • url_pattern_name:パス (path) 方式
    (例 言語コードが en の場合:https://example.com/en)

解決方法

設定ファイルに、下記のように必要なルールを記述してください。
ご使用のWebサーバーにより異なります。

Web サーバーが Apache の場合:.htaccess ファイルに記述

・Rewrite 方式を使用していない場合
(.htaccess ファイルが存在しない場合はドキュメントルートに新規作成)

<IfModule mod_rewrite.c>

RewriteEngine On

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

</IfModule>

・Rewrite 方式を使用している場合

<IfModule mod_rewrite.c>

RewriteEngine On

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

# Don't intercept .cgi files, as they would not execute

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} /$ [OR]

RewriteCond %{REQUEST_URI} \.(html|htm|shtml|php|php3|phtml)

# Use the wovn_index.php to handle static pages
RewriteRule .? wovn_index.php [L]

</IfModule>

Web サーバーが nginx の場合:nginx 設定ファイルに記述

server {

  # …

  # php configuration

  location ~ \.php$ {

    # …

  }

  location / {

    # …

    # WOVN.php interception ####################################################

    # strip language code off of $uri

    rewrite ^/(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)(/.*)$ $2;

    # intercept static content with WOVN.php

    if ($uri ~ (/|\.(html|htm))$) {

      rewrite .? /wovn_index.php;

    }

  }