私は現在 SocialEngine をインストールしており、すべての URL は .htaccess ファイルによって処理され、socialengine.phpファイルにリダイレクトされ、適切な URL などが処理されます。
example.com/
別のインデックス ページを配置したいので、スクリプトへのリダイレクトを停止したいと考えています。だから私は .htaccess ファイルがsocialengine.phpスクリプトを介して見つけることができない他のすべてのファイルを処理し、ルートファイルをindex.phpに保持したいと考えています。
その場合はindex.php.com/
に送られ、それ以外の場合はsocialengine.phpを通じて処理されます。
以下は、変更が必要な .htaccess ファイルです。
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
# Get rid of index.php
RewriteCond %{REQUEST_URI} /socialengine\.php
RewriteRule (.*) socialengine.php?rewrite=2 [L,QSA]
# Rewrite all directory-looking urls
RewriteCond %{REQUEST_URI} /$
RewriteRule (.*) socialengine.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 ^(.*)$ socialengine.php?rewrite=1 [L,QSA]
</IfModule>
返信ありがとうございます。