重写模式(省略url中的index.php)

在apache配置文件httpd.conf中,查找

            1.mod_rewrite.so, 启动此模块

            2.AllowOverride , 值= All

            3. 把下面的内容保存为.htaccess文件放到应用入口文件的同级目录下

1 <IfModule mod_rewrite.c>
2     Options +FollowSymlinks
3     RewriteEngine on
4 
5     RewriteCond %{REQUEST_FILENAME} !-d
6     RewriteCond %{REQUEST_FILENAME} !-f
7     RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
8 
9 </IfModule>

 

相关文章:

  • 2021-06-19
  • 2021-06-27
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
  • 2021-08-30
  • 2021-08-10
猜你喜欢
  • 2022-02-09
  • 2021-05-15
  • 2022-12-23
  • 2022-12-23
  • 2022-02-14
  • 2022-12-23
  • 2021-06-20
相关资源
相似解决方案