1。确认httpd.conf配置文件中加载了mod_rewrite.so 模块,加载的方法是去掉mod_rewrite.so前面的注释#号

2。讲httpd.conf中的Allowoverride  None 将None改为All

3。打开对应的项目配置文件,我的项目配置文件是Myapp/Conf/config.php ,在这个配置文件数组中增加一行,‘URL_MODEL’=>2

4。在项目的根目录下面建立一个.htaccess文件,里面写入下面的内容:

<IfModule rewrite_module>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>

如果你的服务器支持rewrite,现在就可以通过http://localhost/Myapp/Index/index/访问Index模块下面的index操作。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-09
  • 2022-02-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-17
相关资源
相似解决方案