Oxwall htaccess 删除松散 php 文件的扩展名并忽略 index.php 重写
Oxwall htaccess removing extension on loose php file and ignore index.php rewrite
我正在尝试在我的 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
现在,如果我这样做,真实索引将不再正确加载。
有谁知道我做错了什么。或者你有我可以使用的不同解决方案吗?
谢谢,罗宾
通过创建一个名为 test 的文件夹并在该文件夹中添加 index.php 来解决
使用的 htaccess 代码是 RewriteCond %{REQUEST_URI} !/test/
在最终规则之前
所以现在我到这个页面的 url 是 http://www.website.com/test
浪费这几个小时的简单解决方案
干杯
我正在尝试在我的 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
现在,如果我这样做,真实索引将不再正确加载。
有谁知道我做错了什么。或者你有我可以使用的不同解决方案吗?
谢谢,罗宾
通过创建一个名为 test 的文件夹并在该文件夹中添加 index.php 来解决
使用的 htaccess 代码是 RewriteCond %{REQUEST_URI} !/test/
在最终规则之前
所以现在我到这个页面的 url 是 http://www.website.com/test
浪费这几个小时的简单解决方案
干杯