1

プライベート サーバーに SocialEngine PHP の新規インストールを完了しました。

また、Moodle をインストールし、次の方法でアクセスする必要があります。

http://www.example.com/moodle

SocialEngine は独自の .htaccess ファイルを作成するため、moodle ディレクトリにアクセスしようとするたびに、「ページが見つかりません。アクセスしようとしたページが見つかりませんでした」というメッセージが表示されます。リダイレクトにより、SocialEngine プラグイン内の moodle を検索するように強制されるため、/httpdocs 内の /moodle/ ディレクトリにリダイレクトする必要があります。

私は .htaccess オプションに非常に慣れていません。何ができるかについてのヒントが必要です。

.htaccess の内容は次のとおりです。

<IfModule mod_rewrite.c>
  Options +FollowSymLinks
  RewriteEngine On

  # Get rid of index.php
  RewriteCond %{REQUEST_URI} /index\.php
  RewriteRule (.*) index.php?rewrite=2 [L,QSA]

  # Rewrite all directory-looking urls
  RewriteCond %{REQUEST_URI} /$
  RewriteRule (.*) index.php?rewrite=1 [L,QSA]

  # Try to route missing files
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} public\/ [OR]
  RewriteCond %{REQUEST_FILENAME} \.(jpg|gif|png|ico|flv|htm|html|php|css|js)$
  RewriteRule . - [L]

  # If the file doesn't exist, rewrite to index
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?rewrite=1 [L,QSA]

</IfModule>

# sends requests /index.php/path/to/module/ to "index.php"
# AcceptPathInfo On

# @todo This may not be effective in some cases
FileETag Size

提案やヒントをお願いします。

事前にどうもありがとうございました!

よろしく。

4

1 に答える 1

1

すべての書き換えでmoodle-folderを除外し、それが機能するかどうかを確認します。それが機能したら、本当に必要のないすべてのルールでそれを削除します。

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On

# Get rid of index.php
RewriteCond %{REQUEST_URI} !^/moodle
RewriteCond %{REQUEST_URI} /index\.php
RewriteRule (.*) index.php?rewrite=2 [L,QSA]

# Rewrite all directory-looking urls
RewriteCond %{REQUEST_URI} !^/moodle
RewriteCond %{REQUEST_URI} /$
RewriteRule (.*) index.php?rewrite=1 [L,QSA]

# Try to route missing files
RewriteCond %{REQUEST_URI} !^/moodle
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} public\/ [OR]
RewriteCond %{REQUEST_FILENAME} \.(jpg|gif|png|ico|flv|htm|html|php|css|js)$
RewriteRule . - [L]

# If the file doesn't exist, rewrite to index
RewriteCond %{REQUEST_URI} !^/moodle
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?rewrite=1 [L,QSA]

</IfModule>

# sends requests /index.php/path/to/module/ to "index.php"
# AcceptPathInfo On

# @todo This may not be effective in some cases
FileETag Size
于 2011-10-26T17:21:06.887 に答える