我正试图在我的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
我已经能够从rewriterule中排除该文件,如下所示:
RewriteCond %{REQUEST_URI} !/test.php所以现在我可以像这样访问我的文件:http://www.website.com/test.php
或者我可以像这样删除扩展:
RewriteRule ^test test.php现在,如果我这样做,实际的索引将不再正确加载。
有人知道我做错了什么吗。或者你有不同的解决方案,我可以使用?
谢谢,罗宾
发布于 2016-07-28 16:39:20
通过创建名为test的文件夹并在此文件夹中添加index.php来解决此问题
在最终规则之前,使用的htaccess代码是RewriteCond %{REQUEST_URI} !/test/,所以现在我到这个页面的url是http://www.website.com/test
解决这几个小时浪费的一个简单方法
干杯
https://stackoverflow.com/questions/38616210
复制相似问题