只需3步,隱藏thinkphp網址中index.php的方法
時間:2022年3月3日
瀏覽:次
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]