.htaccess Oxwall htaccess删除松散php文件的扩展名并忽略index.php重写

.htaccess Oxwall htaccess删除松散php文件的扩展名并忽略index.php重写,.htaccess,mod-rewrite,oxwall,.htaccess,Mod Rewrite,Oxwall,我正试图在我的oxwall网站上创建一个松散的页面 oxwall的标准htaccess如下所示: Options +FollowSymLinks RewriteEngine On AddEncoding gzip .gz AddEncoding gzip .gzip <FilesMatch "\.(js.gz|js.gzip)$"> ForceType text/javascript </FilesMatch> <FilesMatch "\.(css.gz|c

我正试图在我的oxwall网站上创建一个松散的页面

oxwall的标准htaccess如下所示:

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} !^/index\.php
RewriteCond %{REQUEST_URI} !/ow_updates/index\.php
RewriteCond %{REQUEST_URI} !/ow_updates/
RewriteCond %{REQUEST_URI} !/ow_cron/run\.php
RewriteCond %{REQUEST_URI} !/e500\.php
RewriteCond %{REQUEST_URI} !/captcha\.php

#RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]
RewriteCond %{REQUEST_FILENAME} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php
RewriteRule ^test test.php
现在我可以像这样访问我的文件:

或者我可以像这样删除扩展:

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} !^/index\.php
RewriteCond %{REQUEST_URI} !/ow_updates/index\.php
RewriteCond %{REQUEST_URI} !/ow_updates/
RewriteCond %{REQUEST_URI} !/ow_cron/run\.php
RewriteCond %{REQUEST_URI} !/e500\.php
RewriteCond %{REQUEST_URI} !/captcha\.php

#RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]
RewriteCond %{REQUEST_FILENAME} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php
RewriteRule ^test test.php
现在,如果我这样做,真正的索引将无法正常加载

有人知道我做错了什么吗。或者你有不同的解决方案吗


谢谢,Robin通过创建一个名为test的文件夹并在此文件夹中添加index.php解决了这个问题

使用的htaccess代码是
RewriteCond%{REQUEST\u URI}/在最终规则之前测试/
所以现在我的这个页面的url是

这几个小时的浪费有一个简单的解决方案


通过创建一个名为test的文件夹并在该文件夹中添加index.php,可以解决问题

使用的htaccess代码是
RewriteCond%{REQUEST\u URI}/在最终规则之前测试/
所以现在我的这个页面的url是

这几个小时的浪费有一个简单的解决方案


干杯

你所说的
真正的索引不再正确加载是什么意思
?好吧,
测试
(或
邀请朋友
)仍然与
index.php
匹配,但是如果你把规则放在
index.php
规则之前,这可能并不重要。您没有将条件的第二个参数视为正则表达式,这意味着
匹配的远不止一个文字点。这也没关系。有了
真正的索引将无法再正确加载了
我不确定出了什么问题,它似乎可以正确加载所有样式和内容,但看起来大部分样式都消失了。我确实将规则放在了我的最终规则
RewriteRule(.*)index.php
你所说的
真正的索引不再正确加载是什么意思
?好吧,
测试(或
邀请朋友
)仍然与
index.php
匹配,但是如果您将规则放在
index.php
规则之前,这可能并不重要。您没有将条件的第二个参数视为正则表达式,这意味着
匹配的远不止一个文字点。这也没关系。有了
真正的索引将无法再正确加载了
我不确定出了什么问题,它似乎可以正确加载所有样式和内容,但看起来大部分样式都消失了。我确实将规则放在了最后一条规则
RewriteRule(.*)index.php