1

我正在尝试在我的 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

现在我有一个文件,file.php,放在我网站的根目录中。我希望能够像这样访问这个文件: http ://www.website.com/test

我已经能够通过以下方式从重写规则中排除该文件:

RewriteCond %{REQUEST_URI} !/test.php

所以现在我可以像这样访问我的文件: http ://www.website.com/test.php

或者我已经能够像这样删除扩展名:

RewriteRule ^test test.php

现在,如果我这样做,真正的索引将不再正确加载。

有谁知道我做错了什么。或者您有其他我可以使用的解决方案吗?

谢谢,罗宾

4

1 回答 1

0

通过创建一个名为 test 的文件夹并在此文件夹中添加 index.php 来解决

使用的 htaccess 代码RewriteCond %{REQUEST_URI} !/test/在最终规​​则之前所以现在我到这个页面的 url 是http://www.website.com/test

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

干杯

于 2016-07-28T08:39:19.630 回答