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

thinkphp iisα¾²Ì¬²»Æð×÷ÓÃ

½üÄêÀ´ £¬Ô½À´Ô½¶àµÄ¿ª·¢ÕßÑ¡ÔñʹÓÃthinkphp¿ò¼ÜÀ´¹¹½¨×Ô¼ºµÄwebÓ¦Ó᣶øÔÚʹÓÃthinkphp¿ò¼ÜÖÐ £¬Î±¾²Ì¬ÊÇÒ»¸ö³£¼ûµÄÎÊÌâ¡£ÓÈÆäÊÇÔÚiisЧÀÍÆ÷ÉÏʹÓÃthinkphp¿ò¼Üʱ £¬Ðí¶à¿ª·¢Õß±¨¸æ˵α¾²Ì¬²»Æð×÷Óá£ÄÇô £¬¸ÃÔõÑù½â¾öthinkphp iisα¾²Ì¬²»Æð×÷ÓõÄÎÊÌâÄØ£¿±¾ÎĽ«¶Ô´Ë¾ÙÐÐÆÊÎöÏ¢Õù´ð¡£

Ò»¡¢Ê²Ã´ÊÇα¾²Ì¬

Ê×ÏÈ £¬ÎÒÃÇÐèÒªÏàʶʲôÊÇα¾²Ì¬¡£Í¨³£À´Ëµ £¬ÍøÕ¾µÄURLÁ´½ÓÊÇ´øÓвÎÊýµÄ £¬ÀýÈ磺www.example.com/index.php?id=123¡£ÕâÖַǾ²Ì¬µÄURLÁ´½Ó²»µ«²»ÑÅ¹Û £¬²¢ÇÒÒ²µ¹ÔËÓÚËÑË÷ÒýÇæµÄÅÀÈ¡ºÍÓû§µÄÌåÑé¡£ÓÚÊÇ £¬Î±¾²Ì¬·ºÆðÁË £¬Ëü½«Á´½Óת»»Îª¸ü¼ò½éºÍÓïÒ廯µÄÐÎʽ £¬ºÃ±È£ºwww.example.com/id/123.html¡£ÕâÑùµÄURL¿´ÆðÀ´Ô½·¢ÑŹۡ¢Ò×ÓÚÃ÷È· £¬Ò²¸üÀûÓÚËÑË÷ÒýÇæµÄÓÅ»¯¡£

¶þ¡¢ThinkPHP¿ò¼ÜÖеÄα¾²Ì¬

ÔÚThinkPHP¿ò¼ÜÖÐ £¬Î±¾²Ì¬ÊÇͨ¹ýURLÖØд¹¦Ð§ÊµÏֵġ£Ò»Ñùƽ³£ÇéÐÎÏ £¬ÎÒÃÇʹÓÃ.htaccessÎļþÀ´ÊµÏÖApacheЧÀÍÆ÷µÄURLÖØд¹¦Ð§¡£¶øÔÚIISЧÀÍÆ÷ÉÏ £¬ÎÒÃÇʹÓÃweb.configÎļþÀ´ÊµÏÖURLÖØд¡£

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

ÏÂÃæÊÇÒ»¸ö¼òÆÓµÄweb.configʾÀý £¬¿ÉÒÔʵÏÖÒ»¸ö»ù±¾µÄα¾²Ì¬¹æÔò:

<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Rewrite to index.php">
                    <match url="^(.*)$" />
                    <conditions logicalGrouping="MatchAny">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php/{R:1}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

µÇ¼ºó¸´ÖÆ

ÒÔÉÏ´úÂë»á½«ËùÓÐÇëÇó¶¼ÖØдµ½index.phpÎļþ £¬²¢½«URLµÄ²ÎÊý²¿·Öͨ¹ýб¸ÜÍÑÀëÌí¼Óµ½URLµÄβ²¿¡£ÕâÑù £¬ÎÒÃǾͿÉÒÔʹÓÃÀàËÆwww.example.com/index.php/id/123µÄÁ´½Ó·½·¨À´»á¼ûÒ³Ãæ¡£

Èý¡¢ThinkPHP¿ò¼ÜÖеÄα¾²Ì¬²»Æð×÷ÓÃÎÊÌâÆÊÎö

ÔÚʹÓÃThinkPHP¿ò¼Üʱ £¬ÓÐЩ¿ª·¢Õß·´Ó¦ÎÞ·¨ÀÖ³ÉʵÏÖα¾²Ì¬¹¦Ð§¡£ÎÊÌâ·ºÆðÔÚIISЧÀÍÆ÷ÉÏʱ £¬¾ÍÔ½·¢³£¼û¡£Õâ¸öÎÊÌâµÄ·ºÆðͨ³£ÊÇÓÉÒÔϼ¸¸öÔµ¹ÊÔ­Óɵ¼Öµģº

ЧÀÍÆ÷δÆôÓÃrewriteÄ£¿é¡£

ÔÚIISЧÀÍÆ÷ÉÏÆôÓÃrewriteÄ£¿éºÜÊÇÖ÷Òª¡£ÈôÊÇЧÀÍÆ÷δÆôÓÃrewriteÄ£¿é £¬web.configÎļþÖеĹæÔò½«²»»á±»Ó¦Óá£Òò´Ë £¬ÔÚ¼ì²éÆäËûÎÊÌâ֮ǰ £¬Ó¦¸ÃÈ·±£rewriteÄ£¿éÒÑÆôÓá£

ȱÉÙweb.configÎļþ¡£

ʵÏÖα¾²Ì¬ÐèÒª½«web.configÎļþ°²ÅÅÔÚÓ¦ÓõĸùĿ¼ÖС£ÈôÊÇweb.configÎļþȱʧ¡¢Ãû³Æ»òλÖò»×¼È· £¬Ôòα¾²Ì¬¹æÔò½«²»»á±»Ó¦Óá£

α¾²Ì¬¹æÔòÓÐÎó¡£

α¾²Ì¬¹æÔòÔÚweb.configÎļþÖоÙÐÐÉèÖà £¬ÈôÊÇ·ºÆð¹ýʧ £¬¿ÉÄܻᵼÖ¹æÔòÎÞ·¨Õý³£Ó¦Óá£ÔÚÈ·ÈÏrewriteÄ£¿éÒÑÆôÓò¢ÇÒweb.configÎļþ±£´æµÄÇéÐÎÏ £¬ÐèÒª×Ðϸ¼ì²éα¾²Ì¬¹æÔòÊÇ·ñ׼ȷ¡£

ËÄ¡¢½â¾öThinkPHP¿ò¼ÜÖÐα¾²Ì¬²»Æð×÷ÓõÄÎÊÌâ

Õë¶ÔÉÏÊöÎÊÌâ £¬ÎÒÃÇÏÈÈÝÒÔϼ¸ÖÖ½â¾öÒªÁ죺

ÆôÓÃrewriteÄ£¿é£º

ÔÚIISЧÀÍÆ÷ÉÏÆôÓÃrewriteÄ£¿éµÄÒªÁìÈçÏ£º

1£©ÒÔÖÎÀíÔ±Éí·Ý·­¿ªIISÖÎÀíÆ÷¡£

2£©ÔÚ×ó²àÃæ°åÖÐÕÒµ½Ð§ÀÍÆ÷ £¬ÓÒ»÷¡°ÖÎÀíЧÀÍÆ÷¡± £¬Ñ¡Ôñ¡°Ìí¼Ó½ÇÉ«ºÍ¹¦Ð§¡±¡£

3£©ÕÒµ½ºÍÑ¡Ôñ¡°Web Server (IIS)¡±½ÇÉ« £¬µã»÷¡°ÏÂÒ»²½¡±¡£

4£©ÕÒµ½ºÍÑ¡Ôñ¡°Web Server (IIS)¡±½ÇɫЧÀÍ £¬²¢ÔÚÓҲ๴ѡ¡°URLÖØд¡± £¬µã»÷¡°ÏÂÒ»²½¡±¡£

5£©µã»÷¡°×°Öá±Íê³É×°Öà £¬ÖØÆôIISЧÀÍ¡£

È·ÈÏweb.configÎļþ±£´æÇÒ׼ȷ£º

È·ÈÏÎļþÊÇ·ñ±£´æ¼°ÊÇ·ñ׼ȷ¡£ÈôÊÇÎļþÒѱ£´æ £¬ÇëÈ·±£Ãû³ÆÊÇ·ñ׼ȷ £¬Î»ÖÃÊÇ·ñ׼ȷ¡£

¼ì²éα¾²Ì¬¹æÔòÊÇ·ñ׼ȷ£º

α¾²Ì¬¹æÔò±ØÐè׼ȷÉèÖà £¬²»È»ÎÞ·¨Õý³£ÔËÐС£Òò´Ë £¬ÔÚ¼ì²éα¾²Ì¬¹æÔò֮ǰ £¬ÄúÐèÒª×Ðϸ¼ì²éËüÃÇÊÇ·ñ׼ȷ±àд¡£ÔÚweb.configÎļþÖеĹæÔò±£´æÓï·¨¹ýʧ½«µ¼ÖÂα¾²Ì¬²»Æð×÷Ó᣿ÉÒÔͨ¹ý´ÓÈÕÖ¾ÖÐÕÒµ½¹ýʧÐÂÎÅÀ´ÅÅÅÌÎÊÌâ¡£×î³£¼ûµÄ¹ýʧ°üÀ¨¹æÔòÓï·¨¹ýʧ £¬È±ÉÙÌõ¼þ»òÐж¯ÔªËصÈ¡£

µ÷½âÓ¦ÓóÌÐòÂß¼­£º

µ±ËùÓеÄЧÀÍÆ÷ÉèÖúÍÉèÖö¼ÒÑ׼ȷÍê³É £¬µ«Î±¾²Ì¬¹¦Ð§ÈÔÈ»ÎÞ·¨Õý³£ÊÂÇéʱ £¬¿ÉÄÜÐèÒªÖØмì²éÓ¦ÓóÌÐòµÄÂß¼­¡£ÀýÈç £¬¼ì²éThinkPHP¿ò¼ÜµÄ·ÓɹæÔòºÍURLÌìÉúÒªÁìÊÇ·ñ׼ȷ¡£ÓÐʱ £¬Ó¦ÓóÌÐòµÄÂß¼­¿ÉÄܻᵼÖÂα¾²Ì¬ÎÞ·¨Õý³£ÊÂÇé¡£

Îå¡¢×ܽá

ͨ¹ýÒÔÉÏÄÚÈÝ £¬ÎÒÃÇÏàʶµ½ThinkPHP¿ò¼ÜÖÐα¾²Ì¬²»Æð×÷ÓõÄÎÊÌâͨ³£ÊÇÓÉrewriteÄ£¿éδÆôÓá¢web.configÎļþ¹ýʧ¡¢Î±¾²Ì¬¹æÔò¹ýʧµÈ¶àÖÖÔµ¹ÊÔ­Óɵ¼ÖµÄ¡£Í¨¹ýÆôÓÃrewriteÄ£¿é¡¢È·ÈÏweb.configÎļþºÍα¾²Ì¬¹æÔò £¬ÒÔ¼°¼ì²éÓ¦ÓóÌÐòµÄÂß¼­ £¬ÎÒÃÇ¿ÉÒÔ½â¾öThinkPHP¿ò¼ÜÖÐα¾²Ì¬²»Æð×÷ÓõÄÎÊÌ⡣ֻҪȷ¾Ù¼öÐÐ׼ȷµÄЧÀÍÆ÷ÉèÖúÍÓ¦ÓóÌÐòÉè¼Æ £¬Õâ¸öÎÊÌâ²»ÄÑÃ÷¾ö¡£

ÒÔÉϾÍÊÇthinkphp iisα¾²Ì¬²»Æð×÷ÓõÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

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

18523999891

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

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

QR code
ÍøÕ¾µØͼ