發(fā)表日期:2019-03 文章編輯:小燈 瀏覽次數(shù):3369
蟬知系統(tǒng)支持兩種訪問方式,一種是傳統(tǒng)的get方式,比如/?m=article&id=123,代表文章模塊的123這篇文章。還有一種是靜態(tài)url訪問,比如/article-view-123.html。
從1.5版本開始,蟬知系統(tǒng)內(nèi)置了對搜索引擎特別友好的url路徑結(jié)構(gòu)。上述的靜態(tài)url地址會轉(zhuǎn)變成article/123.html。如果123這篇文章所屬的類目還設置了類目的別名,比如news,地址還會進一步優(yōu)化為news/123.html。
但是要想使用靜態(tài)url方式,需要配置webserver使用靜態(tài)url功能。如果您使用的是網(wǎng)站空間,一般都已經(jīng)打開了。如果是自己部署的服務器,請按照下面的來設置:
apache:
1. 配置apache的配置文件,加載 mod_rewrite模塊。
2. 配置chanzhieps/www目錄下面的.htaccess權(quán)限,比如:
<Directory /home/chanzhieps/www>
Options FollowSymLinks Indexes
AllowOverride All
</Directory>
nginx:
location /
{
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$
{
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $request_uri;
include modules-enabled/fastcgi.conf;
}
如果是已經(jīng)開始使用的蟬知系統(tǒng)配置靜態(tài)url功能,確保以上配置成功后重新安裝蟬知系統(tǒng)或修改chanzhi/system/config/my.php內(nèi)requestType值為PATH_INFO(5.2+版本需要安裝成功后進入后臺--設置--站點設置,5.4+版本在后臺--設置--站點--系統(tǒng)設置, 切換url模式)。
寶塔面板nginx環(huán)境:
1. 登錄寶塔,點擊站點設置;
2. 進入配置,點擊配置文件,將配置信息復制進人文本框;復制之后,點擊保存。
server { listen 80; server_name www.abc.cn; index index.php index.html index.htm default.php default.htm default.html; root /www/wwwroot/www.abc.cn; # 需要根據(jù)具體路徑填寫 location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/tmp/php-cgi-70.sock; #根據(jù)實際啟動的php版本選擇 fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $request_uri; include /www/server/nginx/conf/fastcgi.conf; # 需要根據(jù)具體路徑填寫 } }
3. 重啟nginx或者重載nginx配置
4. 訪問蟬知,確認PATH_INFO可以正常訪問嗎?
后臺開啟PATH_INFO
日期:2019-03 瀏覽次數(shù):5015
日期:2019-03 瀏覽次數(shù):4668
日期:2019-03 瀏覽次數(shù):4608
日期:2019-03 瀏覽次數(shù):5055
日期:2019-03 瀏覽次數(shù):4155
日期:2019-03 瀏覽次數(shù):4031
日期:2019-03 瀏覽次數(shù):4060
日期:2019-03 瀏覽次數(shù):3847
日期:2019-03 瀏覽次數(shù):4103
日期:2019-03 瀏覽次數(shù):3975
日期:2019-03 瀏覽次數(shù):3247
日期:2019-03 瀏覽次數(shù):4355
日期:2019-03 瀏覽次數(shù):3363
日期:2019-03 瀏覽次數(shù):3258
日期:2019-03 瀏覽次數(shù):3368
日期:2019-03 瀏覽次數(shù):3386
日期:2019-03 瀏覽次數(shù):3351
日期:2019-03 瀏覽次數(shù):3321
日期:2019-03 瀏覽次數(shù):4084
日期:2019-03 瀏覽次數(shù):4614
日期:2019-03 瀏覽次數(shù):5594
日期:2019-03 瀏覽次數(shù):4174
日期:2019-03 瀏覽次數(shù):4818
日期:2019-03 瀏覽次數(shù):3801
日期:2019-03 瀏覽次數(shù):3300
日期:2019-03 瀏覽次數(shù):4297
日期:2019-03 瀏覽次數(shù):3355
日期:2019-03 瀏覽次數(shù):3255
日期:2019-03 瀏覽次數(shù):3643
日期:2019-03 瀏覽次數(shù):2734
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.