phpstudy部署thinkPHP


利用phpstudy配置虚拟主机

Listen 8080
<VirtualHost _default_:80>
DocumentRoot "D:\phpStudy\WWW"
  <Directory "D:\phpStudy\WWW">
    Options -Indexes +FollowSymLinks +ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted
  </Directory>
</VirtualHost>


<VirtualHost *:8080>
    DocumentRoot "D:\GitHub\TPVueTODO\public"
    ServerName www.todo.com
    ServerAlias todo.com
  <Directory "D:\GitHub\TPVueTODO\public">
      Options FollowSymLinks ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
      Require all granted
  </Directory>
</VirtualHost>

注意是public目录

url 重写

但入口文件访问时url总需要带上index.php,实际使用中可以使用apace的url重写模块完成自动加入index.php。这个需要public下面的.htaccess文件。如果碰到No input file specified.可能需要修改下这个文件:

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

在默认情况下会导致No input file specified. 修改成:

RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM