Linux/UNIX で Web サイトを運営していますが、.htaccess ファイルとその中で使用されている構文についてまったく知りません。
システムにアクセスしhttp://pr.bananapages.net
ても、結果は得られません。しかし、ファイル名を追加すると、それが表示されます。元:http://pr.bananapages.net/index.html
注: URL は共有アクセス ホスティング サーバーのサブフォルダーを指していますが、実際には重要でwww.bananapages.net/pr/hamshack
はありません。実際に指定せずに。
見つけたものはすべて試しましDirectoryIndex
たが、ファイル名を使用しないと機能しません... (index.html)
これが私の現在の.htccess
ファイルです。
Options -MultiViews
DirectoryIndex system.php index.php
<IfModule mod_rewrite.c>
DirectoryIndex system.php index.php index.html
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)\.(.*)$
RewriteRule ^(.+[^/])$ http://%{HTTP_HOST}%{REQUEST_URI}/ [L,R=301]
# Google sitemap controller
RewriteRule ^sitemap.xml$ tmp/sitemap.xml [L]
RewriteRule ^tmp/sitemap.xml$ tmp/sitemap.xml [L]
RewriteRule ^index.html$ index.html [L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*)(\.xml|\.php([0-9]*)|\.tpl|\.phtml|\.ini|\.inc|/)$ system.php?_p=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ system.php?_p=$1 [QSA,L]
</IfModule>
# compresses text, html, javascript, css and xml
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml
AddOutputFilterByType DEFLATE application/javascript application/x-javascript
</IfModule>
注:ファイルの名前を変更する.htaccess
と、ファイル名 (index.html) を指定しなくても機能します。.htaccess
このファイルには、これが望ましい方法で機能するのを妨げている何かがあると確信しています。