首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从Oxwall URL中删除index.php

从Oxwall URL中删除index.php
EN

Stack Overflow用户
提问于 2013-06-03 15:29:45
回答 1查看 1.5K关注 0票数 1

我刚刚在共享的1和1主机上安装了Oxwall (oxwall.org),并希望从所有URL中删除"index.php“。

本质上,PHP需要看到这个http://site.com/index.php/Page/Param1/Param2 而我希望用户看到这个http://site.com/Page/Param1/Param2

我知道这应该用.htaccess文件来完成,但我不知道怎么做.

目前,.htaccess文件如下所示:

代码语言:javascript
复制
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 %{HTTP_HOST} !oxwall.(host).com$

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} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php

有什么建议吗?我在堆栈溢出上发现了类似的消息,但是我无法将建议的修复应用到我的.htaccess文件中.

非常感谢您的时间和支持!

EN

回答 1

Stack Overflow用户

发布于 2013-06-04 09:45:28

找到解决办法了!只需使用本主题中提到的htaccess代码:http://www.oxwall.org/forum/topic/7924

希望这能帮到别人!

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16900391

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档