我正在尝试在我的 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
现在,如果我这样做,真正的索引将不再正确加载。
有谁知道我做错了什么。或者您有其他我可以使用的解决方案吗?
谢谢,罗宾