我刚刚在共享的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文件如下所示:
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文件中.
非常感谢您的时间和支持!
发布于 2013-06-04 09:45:28
找到解决办法了!只需使用本主题中提到的htaccess代码:http://www.oxwall.org/forum/topic/7924
希望这能帮到别人!
https://stackoverflow.com/questions/16900391
复制相似问题