,怎么去掉forum.php或,怎么去掉portal.php?

用户投稿 124 0

关于“php_rewriterule”的问题,小编就整理了【2】个相关介绍“php_rewriterule”的解答:

怎么去掉forum.php或,怎么去掉portal.php?

如果你想去掉,这需要用到伪静态。 php程序可以个性.htaccess文件 代码如下: RewriteEngineon RewriteBase/ RewriteRule^index.html($)index.php[L] RewriteRule^portal/($)portal.php[L] RewriteRule^forum($)forum.php[L] 参照着个修改,可以用index.html,index.do等等都行。

CI框架怎么去掉隐藏入口文件index.php?

1.

  LoadModule rewrite_module modules/mod_rewrite.so,把该行前的#去掉。

  搜索 AllowOverride None(配置文件中有多处),看注释信息,将相关.htaccess的该行信息改为AllowOverride All。

  2.在CI的根目录下,即在index.php,system的同级目录下,建立.htaccess,直接建立该文件名的不会成功,可以先建立记事本文件,另存为该名的文件即可。内容如下(CI手册上也有介绍):

  RewriteEngine on

  RewriteCond $1 !^(index\.php|images|robots\.txt)

  RewriteRule ^(.*)$ /index.php/$1 [L]

  如果文件不是在www的根目录下,例如我的是:,第三行需要改写为RewriteRule ^(.*)$ /CI/index.php/$1 [L]。

  另外,我的index.php的同级目录下还有js文件夹和css文件夹,这些需要过滤除去,第二行需要改写为:RewriteCond $1 !^(index\.php|images|js|css|robots\.txt)。

到此,以上就是小编对于“php_rewriterule”的问题就介绍到这了,希望介绍关于“php_rewriterule”的【2】点解答对大家有用。

抱歉,评论功能暂时关闭!