我有以下 .htaccess 文件:
DirectoryIndex index.html
Options +FollowSymLinks
RewriteEngine On
AddEncoding gzip .gz
AddEncoding gzip .gzip
<FilesMatch "\.(js.gz|js.gzip)$">
ForceType text/javascript
</FilesMatch>
<FilesMatch "\.(css.gz|css.gzip)$">
ForceType text/css
</FilesMatch>
#RewriteCond %{REQUEST_URI} .*/http-bind
#RewriteRule (.*) /http-bind [L]
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_URI} !/ow_updates/index\.php
RewriteCond %{REQUEST_URI} !/ow_updates/
RewriteCond %{REQUEST_URI} !/ow_cron/run\.php
RewriteCond %{REQUEST_URI} !/index\.html
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
我希望 .htaccess 中的所有其他内容都像以前一样工作:重定向所有请求,除了那些用!
to指定的请求index.php
。但是,我需要index.html
在第一次加载网站时加载,然后它们会继续加载index.php
。
所以我DirectoryIndex index.html
在开头加了一行,然后又加了一行RewriteCond %{REQUEST_URI} !/index\.html
,希望用户在输入的时候http://url.com
,会被带到index.html文件中,从里面进入到内页,http://url.com/homepage
里面的页面都是由index.php
.
但是,这不起作用。我使用的软件是Oxwall。该站点只是忽略了第一行并继续加载 index.php 无论如何。我能做些什么来解决这个问题?谢谢。