php框架

 首页 > php框架 > ThinkPHP > thinkphp 去掉URL 里面的index.php

thinkphp 去掉URL 里面的index.php

分享到:
【字体:
导读:
          例如你的原路径是 http://localhost/test/index.php/home/goods/index.html 那么现在的地址是 http://localhost/test/home/goods/index.html 如何去掉index.php呢? 1.httpd.conf配置文件中加载了mod_rewrite.so模块 //在APAC...

例如你的原路径是 http://localhost/test/index.php/home/goods/index.html

那么现在的地址是 http://localhost/test/home/goods/index.html 如何去掉index.php呢?


1.httpd.conf配置文件中加载了mod_rewrite.so模块  //在APACHE里面去配置 #LoadModule rewrite_module modules/mod_rewrite.so把前面的警号去掉

2.AllowOverride None 改None改为 All      //在APACHE里面去配置 (注意其他地方的AllowOverride也统统设置为ALL)

<Directory "D:/server/apache/cgi-bin">

  #AllowOverride none     
  AllowOverride ALL
  Options None
  Order allow,deny
  Allow from all
Directory>

3.确保 config.php  里面配置项 URL_MODEL 设置为 2  return Array(    ‘URL_MODEL‘ => ‘2‘, );

4 .htaccess文件必须放到项目跟目录下 这个文件里面加:

  RewriteEngine on

  RewriteCond %{REQUEST_FILENAME} !-d

  RewriteCond %{REQUEST_FILENAME} !-f

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

详细见此文:

http://www.cnblogs.com/summerzi/p/3868566.html

分享到:
ThinkPHP3 伪静态和URL重写 多重匹配的简...
根据ThinkPHP3.0的手册URL重写的那一节配置Apache。 然后再网站根目录下放置.htaccess文件,内容如手册所提示的一样 win2003的空间iis6不支持.htaccess,尽可能选用linux系统的服务器   Htaccess代码         RewriteEngine on      ...
thinkphp使用PHPMailer发送邮件
第一步:准备PHPMailer 使用PHPMailer发送邮件,首先下载个PHPMailer 将下载的PHPMailer放到ThinkPHP文件夹里面的ThinkPHPExtendVendor 第二步:配置配置文件 修改conf.php文件 邮件配置: //邮件配置     &#039;THINK_EMAIL&#039; => array(        &#039;SMTP_HOST&#039...
  •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
  • 在这里……