次の .htaccess ファイルがあります。
AddDefaultCharset utf-8
RewriteEngine on
Options +SymLinksIfOwnerMatch
RewriteBase /
# redirect all www-requests to no-www
# -
RewriteCond %{HTTP_HOST} ^www\.site\.com$ [NC]
RewriteRule ^(.*)$ http://site.com/$1 [R=301,L]
# redirect all home pages to / (root)
# -
RewriteCond %{THE_REQUEST} ^.*/index\.(php|html?)
RewriteRule ^(.*)index\.(php|html?)$ /$1 [R=301,L]
# remove trailing slash from dirs
# -
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)/$ /$1 [R=301,L]
# automatically add index.php when needed
# -
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|login\.php|reg\.php|robots\.txt|css/|js/)
RewriteRule ^(.*)$ /index.php [L]
.htaccess ファイルは次のことを行う必要があります (SEO のため)。
- ノーwwwへの変換(
http://www.site.comなるはずhttp://site.com) - 末尾にスラッシュがあるすべての URI は、no-trailing-slash に変換する必要があります:
http://site.com/me/リダイレクトする必要がありますhttp://site.com/me - を含むすべての URI は、
index.php/index.html何も変換しないhttp://site.com/admin/index.phpかhttp://site.com/admin/、最終的に次のように表示する必要があります。http://site.com
ただし、現在のバージョンの .htaccess では、アクセスしようとすると循環リダイレクトが発生します ( http://site.com/admin)。ブラウザが取得する必要がある実際のドキュメントはhttp://site.com/admin/index.php.
誰でもこの問題で私を助けてもらえますか?