我有以下.htaccess文件:的DirectoryIndex的.htaccess指令被覆盖的RewriteRules
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别的工作,就像是:重定向除了那些!
指定的所有请求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。我能做些什么来弥补这一点?谢谢。
谢谢;是的,这确实是一种可能性,但我想避免它,因为在主站点脚本中已经有很多cookie /会话操作,并且我会干涉该逻辑...... –