1
我想在我的oxwall网站上创建一个松散的页面。Oxwall htaccess删除扩展名的宽松php文件,并忽略index.php重写
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,放在我的网站的根。 我希望能够访问此文件是这样的:所以,现在我可以访问我的文件中像这样
RewriteCond %{REQUEST_URI} !/test.php
我已经能够排除来自重写规则的文件,这样的: http://www.website.com/test.php
或者我已经能够删除扩展这样的:
RewriteRule ^test test.php
现在,如果我这样做,真正的索引将不会再正常加载。
有谁知道我做错了什么。或者你有不同的解决方案,我可以使用?
谢谢,罗宾
瓦你的意思是“真正的索引不会再正常加载”吗? – anubhava
那么'test'(或'invite-friends')仍然与index.php匹配,但如果你将规则放在'index.php'规则之前,这可能不需要关心。你没有把你的条件的第二个参数看作是正则表达式,这意味着'.'匹配的不仅仅是一个字面点。这也无关紧要。 – Sumurai8
随着'真正的索引将无法正常加载'我不知道什么是错的,它似乎加载所有的样式和东西正常,但它看起来像大部分的风格都消失了。 我确实在我的最终规则之前放置了规则'RewriteRule(。*)index.php' – Robin