我用的Apache和php的搭配,在我的www的目录下有个文件夹admin ,admin夹下有个profile.html文件。我想实现输入http://localhost/admin  ,就直接打开了profile.html文件,换句话说,要实现访问如下两个地址,能看到同一个页面(profile.html)的功能:
1、http://......./admin/
2、http://......./admin/profile.html 。有知道怎么做的吗?谢谢了。

解决方案 »

  1.   

    apache有项设置DirectoryIndex index.php index.html……你可以将profile.html添加到第一位这样就算目录下有index.php,也优先显示profile.html
      

  2.   

     index profile.html index.html index.htm index.php;
      

  3.   

    您说的是配置 Apache的httpd.conf这个文件吗?我用的是phpstudy集成安装的啊,在这个文件中,没有找到你说的那个选项啊。
      

  4.   

    你的  httpd.conf没有   directoryindex???你添加了试试。记得重启。<IfModule dir_module>
        DirectoryIndex profile.html index.php
    </IfModule>
      

  5.   


    改了配置了,但是我输入http://localhost:8080/admin,会自动改成http://localhost:8080/admin/的形式,而且我看到的是文件目录的形式啊。
    Index of /admin    * Parent Directory
        * profile.html
      

  6.   

    改了配置了,但是我输入http://localhost:8080/admin,会自动改成http://localhost:8080/admin/的形式,而且我看到的是文件目录的形式啊。
    Index of /admin  * Parent Directory
      * profile.html
    怎么回事啊?
      

  7.   

    1,2楼说的是对的.
    找下看有没有host.conf的文件.