Typecho伪静态规则、301跳转
生活随笔
收集整理的這篇文章主要介紹了
Typecho伪静态规则、301跳转
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
Typecho程序的偽靜態(tài)規(guī)則不同于wp直接默認可用,需要我們手工加載到空間中才可以生效。下面整理了這款程序在不同的主機環(huán)境中的偽靜態(tài)規(guī)則,希望對大家有所幫助。
1、Linux Apache環(huán)境(.htaccess):
<IfModule mod_rewrite.c> RewriteEngine On # 下面是在根目錄,文件夾要修改路徑 RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 [L] </IfModule>
2、Linux Apache環(huán)境(Nginx):
location / { index index.html index.php; if (-f $request_filename/index.html) { rewrite (.*) $1/index.html break; } if (-f $request_filename/index.php) { rewrite (.*) $1/index.php; } if (!-f $request_filename) { rewrite (.*) /index.php; } }
3、Windows IIS6偽靜態(tài)(httpd.ini):
[ISAPI_Rewrite] # 3600 = 1 hour CacheClockRate 3600 RepeatLimit 32 # 中文tag解決 RewriteRule /tag/(.*) /index\.php\?tag=$1 # sitemapxml RewriteRule /sitemap.xml /sitemap.xml [L] RewriteRule /favicon.ico /favicon.ico [L] # 內(nèi)容頁 RewriteRule /(.*).html /index.php/$1.html [L] # 評論 RewriteRule /(.*)/comment /index.php/$1/comment [L] # 分類頁 RewriteRule /category/(.*) /index.php/category/$1 [L] # 分頁 RewriteRule /page/(.*) /index.php/page/$1 [L] # 搜索頁 RewriteRule /search/(.*) /index.php/search/$1 [L] # feed RewriteRule /feed/(.*) /index.php/feed/$1 [L] # 日期歸檔 RewriteRule /2(.*) /index.php/2$1 [L] # 上傳圖片等 RewriteRule /action(.*) /index.php/action$1 [L]
總結(jié)
以上是生活随笔為你收集整理的Typecho伪静态规则、301跳转的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Typecho修改header.php自
- 下一篇: typecho缩略图函数分享