尊龙凯时人生就是搏

nginxÔõôα¾²Ì¬

nginx α¾²Ì¬ÉèÖÃ

α¾²Ì¬ÊÇÖ¸½«¶¯Ì¬Íøַת»»Îª¾²Ì¬ÍøÖ·£¬´Ó¶øÌá¸ßÍøÕ¾Çå¾²ÐÔ²¢¸ÄÉÆÓû§ÌåÑé¡£Nginx ÖпÉÒÔͨ¹ýÒÔÏ°취ÉèÖÃα¾²Ì¬£º

1. ÆôÓÃα¾²Ì¬Ä£¿é

ÔÚ Nginx ÉèÖÃÎļþÖУ¬ÕÒµ½ http{} ¿é£¬²¢ÔÚÆäÖÐÌí¼ÓÒÔÏÂÐУº

load_module rewrite_module modules/mod_rewrite.so;

µÇ¼ºó¸´ÖÆ

2. ½ç˵α¾²Ì¬¹æÔò

ÔÚ http{} ¿éÄÚ£¬Ìí¼ÓÒÔÏÂα¾²Ì¬¹æÔò£º

rewrite ^/(.+) /index.php?q=$1 last;

µÇ¼ºó¸´ÖÆ

´Ë¹æÔò½«½«ËùÓж¯Ì¬ URL£¨ÒÔ / ¿ªÍ·£©ÖØдΪ¾²Ì¬ URL£¨/index.php£©£¬²¢½«¶¯Ì¬²¿·Ö×÷Ϊ q ²ÎÊýת´ï¡£

3. ´¦ÀíÅÌÎÊ×Ö·û´®

ÔÚ index.php ÎļþÖУ¬Ê¹ÓÃÒÔÏ´úÂë´¦ÀíÅÌÎÊ×Ö·û´®£º

<?php $query = $_GET['q'];
// ´¦Àí¶¯Ì¬ÄÚÈÝ
?>

µÇ¼ºó¸´ÖÆ

4. ʾÀý

ÀýÈ磬ÈôÊÇÓÐÒ»¸ö¶¯Ì¬ URL /articles/10£¬ÖØдºó½«±äΪ /index.php?q=articles/10¡£index.php ½«ÎüÊÕ q ²ÎÊýΪ articles/10£¬²¢ÏÔʾÏìÓ¦µÄÎÄÕ¡£

ÀûÒæ

α¾²Ì¬ÉèÖÃÌṩÁËÒÔÏÂÀûÒ棺

Ìá¸ßÇå¾²ÐÔ£ºÒþ²Ø¶¯Ì¬ÍøÖ·£¬½µµÍ±»¹¥»÷µÄΣº¦¡£

¸ÄÉÆÓû§ÌåÑ飺¾²Ì¬ÍøÖ·¸üÒ×ÓÚ¼ÇןͷÖÏí¡£

Ìá¸ßËÑË÷ÒýÇæÓÅ»¯£¨SEO£©£ºËÑË÷ÒýÇæÇãÏòÓÚ¾²Ì¬ÍøÖ·¡£

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

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

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是搏

18523999891

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

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

QR code
sitemap¡¢ÍøÕ¾µØͼ