5

MSM プラグインを使用して、2 つの異なるドメイン名で 2 つの ExpressionEngine サイトを実行しています。サイト 1 にはすべてのシステム ファイルなどがあり、サイト 2 はサイト 1 のサブフォルダーにあります。私の質問は、サイト 2 の URL に index.php ファイルが含まれていなくても機能するようにするにはどうすればよいですか?

現在、サイト1のhtaccessフォルダーにこれがあり、サイト1はうまく機能しますが、サイト2は機能しません:

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Removes index.php
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]

    DirectoryIndex index.html index.php

    # Redirect non-www urls to www
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

    # If 404s, "No Input File" or every URL returns the same thing
    # make it /index.php?/$1 above (add the question mark)

4

3 に答える 3

3

同じ .htaccess が両方のサイトで機能するはずです。書き換えには、各サイトのルートにローカルな index.php ファイルのみが含まれます。

.htaccess から考えられる問題の 1 つは、www 以外の URL を www にリダイレクトしていることです。2 番目のドメインは www で動作するように設定されていますか? そうでない場合、これは明らかに問題になります。

于 2012-11-05T15:49:34.450 に答える
1

私はこのhtaccessファイルをプライマリサイトとセカンダリサイトの両方で使用していますが、すべて問題ありません。

AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm

AcceptPathInfo On

Options -Indexes

<IfModule mod_rewrite.c>
RewriteEngine On

Options +FollowSymLinks

# Looks for files and directories that do not exist
# and provide the segments to the index.php file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^/index.php
RewriteCond $1 !.(css|js|png|jpe?g|gif|ico)$ [NC]
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>  
于 2012-11-05T09:46:51.923 に答える