yhl27ml@163.com 2011-05-04 17:22:38 3761次浏览 5条回复 0 0 0

我在配置 urlManager 时,设置 showScript = false,本地运行时可以识别这个 url,但是我放到 win2003 里面的时候,如果把 index.php 隐藏起来的话,就识别不了这个 url ,求助!!!大虾们,帮忙下,3ks!

  • 回复于 2011-05-04 17:33 举报

    win2003是否打开URL重写?

  • 回复于 2011-05-05 08:46 举报

    在apache里面已经开启了rewrite

  • 回复于 2011-05-05 11:50 举报

    还有Override改了没 = =

  • 回复于 2011-12-16 13:09 举报

    apache 下的 httpd.conf 中,

    1. #LoadModule rewrite_module modules/mod_rewrite.so 的 # 去掉
    2. config/main.php中

       // uncomment the following to enable URLs in path-format
       /**/
       'urlManager'=>array(
         'urlFormat'=>'path',
         'showScriptName'=>false,
         'rules'=>array(
           '<controller:\w+>/<id:\d+>'=>'<controller>/view',
           '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
           '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
         ),
       ),
      
    3. 在应用程序的目录下建立.htaccess文件(注意,与protected同级)

       RewriteEngine on
       # if a directory or a file exists, use it directly
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
      
       # otherwise forward it to index.php
       RewriteRule . index.php
      
  • 回复于 2012-02-08 15:47 举报

    如果 有模块存在这个隐藏好像就不能用啊

您需要登录后才可以回复。登录 | 立即注册