×ðÁú¿­Ê±¹ÙÍøµÇ¼

thinkphpÍø̨·¾¶ÔõÑùÉèÖÃ

Ò»¡¢Ê²Ã´ÊÇÍø̨·¾¶

Íø̨·¾¶ÊÇÖ¸WebЧÀÍÆ÷ÉϵÄÐéÄâ·¾¶£¬ËüÓëÎļþϵͳ·¾¶²î±ð¡£ÎªÈ·±£³ÌÐòÕý³£ÔËÐУ¬ÎÒÃÇÐèҪ˼Á¿Ä¿½ñϵͳÇéÐαäÁ¿¡¢²Ù×÷ϵͳµÈÒòËØ£¬²¢ÏìÓ¦µØÉèÖÃÍø̨·¾¶¡£

¶þ¡¢Íø̨·¾¶µÄ×÷ÓÃ

Íø̨·¾¶ÔÚThinkPHP¿ò¼ÜÖÐÓÐ×ÅÖ÷ÒªµÄ×÷Óá£Í¨¹ýÉ趨Íøվ·¾¶£¬ÎÒÃÇ¿ÉÒÔʵÏÖ¶ÔWebÓ¦ÓóÌÐòµÄ»á¼û¿ØÖƺÍÍøÕ¾Êý¾ÝÖÎÀíµÈ¹¦Ð§¡£

Á¬Ã¦Ñ§Ï°¡°PHPÃâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡±£»

Èý¡¢ThinkPHPÍø̨·¾¶µÄÉèÖÃÒªÁì

1¡¢µÚÒ»ÖÖÒªÁì

ÔÚconfig.phpÎļþÖÐÌí¼ÓÒÔÏ´úÂ룺

'domain' => [
    'www.test.com' => '/home/test/www',
],

µÇ¼ºó¸´ÖÆ

ÔÚÕâ¸öʾÀýÖУ¬ÎÒÃÇÉèÖÃÁËÒ»¸öÃûΪ¡°www.test.com¡±µÄÍøÕ¾ÓòÃû£¬¸ÃÓòÃûµÄ¸ùĿ¼Ϊ¡°/home/test/www¡±¡£ÈôÊÇ´ËʱÎÒÃÇ»á¼ûÍøÕ¾¡°www.test.com¡±£¬ÏµÍ³¾Í»á×Ô¶¯½«ÆäÓ³Éäµ½¡°/home/test/www¡±Ä¿Â¼Ï¡£

2¡¢µÚ¶þÖÖÒªÁì

ÔÚÍøÕ¾¸ùĿ¼Ï£¬ÎÒÃÇ¿ÉÒÔн¨Ò»¸ö.htaccessÎļþ£¬ÆäÖÐÌí¼ÓÒÔÏ´úÂ룺

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteRule ^(.*)$ /index.php/$1 [L]

µÇ¼ºó¸´ÖÆ

ÕâÑù¾Í¿ÉÒÔ½«ËùÓÐÇëÇó¶¼Ó³Éäµ½index.phpÎļþÖУ¬²¢ÇÒ×Ô¶¯½«URL²ÎÊý×÷Ϊº¯Êý²ÎÊýת´ï¸øindex.phpÎļþ¡£

ÒÔÉÏÁ½ÖÖÒªÁ춼¿ÉÒÔʵÏÖÍø̨·¾¶µÄÉèÖã¬ÎÒÃÇ¿ÉÒÔƾ֤ÏêϸµÄÇéÐÎÑ¡ÔñÏìÓ¦µÄʵÏÖ·½·¨¡£

ËÄ¡¢Íø̨·¾¶µÄʹÓÃ

ÉèÖÃÁËÍø̨·¾¶ºó£¬ÎÒÃǾͿÉÒÔÔÚ³ÌÐòÖÐʹÓÃÄ¿½ñÍøÕ¾µÄ¸ùĿ¼ÁË¡£ÔÚ³ÌÐòÖУ¬ÎÒÃÇ¿ÉÒÔÓó£Á¿¡°__ROOT__¡±À´´ú±íÍøÕ¾µÄ¸ùĿ¼¡£

ÔÚ¿ØÖÆÆ÷ÎļþÖУ¬ÎÒÃÇ¿ÉÒÔÕâÑùʹÓãº

<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
  public function index(){
    $this->display(__ROOT__.'/index.html');
  }
}

µÇ¼ºó¸´ÖÆ

ÔÚÊÓͼÎļþÖУ¬ÎÒÃÇ¿ÉÒÔÕâÑùʹÓãº

<script src="__ROOT__/public/jquery.js"></script>

µÇ¼ºó¸´ÖÆ

ÒÔÉÏ´úÂ뽫×Ô¶¯Ê¶±ðÄ¿½ñÍøÕ¾µÄ¸ùĿ¼£¬²¢½«ÏìÓ¦µÄÎļþÓ³Éäµ½WebЧÀÍÆ÷µÄÐéÄâ·¾¶ÖС£

ÒÔÉϾÍÊÇthinkphpÍø̨·¾¶ÔõÑùÉèÖõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎ壬9:30-18:30£¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ