ThinkPHP学习引见之一:部署目录

WBOY
Release: 2016-06-13 13:19:35
Original
750 people have browsed it

ThinkPHP学习介绍之一:部署目录

ThinkPHP项目部署介绍:

为了提高网站的安全性,系统目录和项目目录可以放到非WEB访问目录下面,网站目录下面只需要放置Public公共目录和入口文件。

如下图(个人思路分享给大家,踊跃发言,互相学习!!):

另附两个小而实用切必须的技术,呵呵,看ThinkPHP手册摘来的。。。

1、实现URL访问不区分大小写

      把下面这段配制写到项目目录的配制文件中(app/Conf/config.php.)

   // 实现URL访问不区分大小写
   'URL_CASE_INSENSITIVE' =>true
Copy after login

2、通常的URL里面含有index.php,为了达到更好的SEO效果可能需要去掉URL里面的index.php

  通过URL重写的方式可以达到这种效果,通常需要服务器开启URL_REWRITE模块才能支持。

  下面是Apache的配置过程,可以参考下:

  1、httpd.conf配置文件中加载了mod_rewrite.so模块

  2、AllowOverride None 将None改为 All

  3、确保URL_MODEL设置为2

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

  

  RewriteEngine on

  RewriteCond %{REQUEST_FILENAME} !-d

  RewriteCond %{REQUEST_FILENAME} !-f

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

  

  重启Apache即可

 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!