在時離不了CMS係統,其中基於ThinkPHP(TP)框架的係統占絕大多數。ThinkPHP是一個快速、兼容而且簡單的輕量級國產PHP開發框架,誕生於2006年初,原名FCS,2007年元旦正式更名為ThinkPHP,遵循Apache2開源協議發布,從Struts結構移植過來並做了改進和完善,同時也借鑒了國外很多優秀的框架和模式,使用麵向對象的開發結構和MVC模式,融合了Struts的思想和TagLib(標簽庫)、RoR的ORM映射和ActiveRecord模式。
一、在Nginx下的偽靜態規則,一般命名Nginx.conf
locations / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; } }
二、在Apache下的偽靜態規則, 一般命名.htaccess
<IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L] </IfModule>
三、在Windows的IIS下的偽靜態規則,一般命名web.Config
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="OrgPage" stopProcessing="true"> <match url="^(.*)$" ></match> <conditions logicalGrouping="MatchAll"> <add input="{HTTP_HOST}" pattern="^(.*)$" ></add> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" ></add> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" ></add> </conditions> <action type="Rewrite" url="index.php/{R:1}" ></action> </rule> </rules> </rewrite> </system.webServer> </configuration>
我漢獅網絡提供網站建設、APP軟件開發、軟件開發、小程序開發、網站網絡營銷等一站式服務,歡迎企業谘詢
免費谘詢:18838171308
免費谘詢:18838171308