安信科技官網-觸屏版

      當前位置:首頁 > 安信自媒體 > 建站經驗

      只需3步,隱藏thinkphp網址中index.php的方法

      時間:2022年3月3日 瀏覽:
      ThinkPHP 下如何隱藏index.php

      Tinkphp的URL重寫模式:以后遇到相同問題,首先要想到URL重寫模式。

      第1步.
      httpd.conf配置文件中加載了mod_rewrite.so模塊

      第2步.
      AllowOverride None 將None改為 All

      第3步.把下面的內容保存為.htaccess文件放到應用入口文件的同級目錄下


      Options +FollowSymlinks
      RewriteEngine On

      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      #RewriteCond $1 !^(DATA|images|otherThings)
      RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]


      當前頁面電腦端訪問網址:


      發送給朋友 分享到朋友圈

      手機版電腦版