Typecho 프로그램의 다양한 웹 서버 퍼머링크 규칙 총정리

7,672 2

Typecho는 중국인이 개발한 매우 훌륭한 블로그 시스템으로, 코드가 작고 간단하며 사용하기 쉽습니다. 최근 Typecho로 구축된 프로젝트가 하나 있어 자연스럽게 이 프로그램에 대해 조금 살펴보게 되었는데, 가장 큰 문제는 역시 퍼머링크 부분이었습니다. 공식적으로 IIS와 Nginx의 퍼머링크 규칙을 제공하지 않아 자료를 검색하고 호환성을 테스트하느라 한참을 고생해야 했습니다. 다행히 오랫동안 작업한 끝에 수확이 있었고, 아래에 다양한 웹 서버에서 Typecho를 구축할 때 사용하는 퍼머링크 규칙을 정리해 올립니다. 여러분이 직접 찾아보는 수고를 덜 수 있기를 바랍니다.

Apache

Plain Text
<IfModule mod_rewrite.c>RewriteEngine OnRewriteBase /RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]</IfModule>

Nginx

Plain Text
if (!-e $request_filename) {    rewrite ^(.*)$ /index.php$1 last;}

IIS

Plain Text
[ISAPI_Rewrite]CacheClockRate 3600RepeatLimit 32RewriteRule /tag/(.*) /index\.php\?tag=$1RewriteRule /sitemap.xml /sitemap.xml [L]RewriteRule /favicon.ico /favicon.ico [L]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]RewriteRule /feed/(.*) /index.php/feed/$1 [L]RewriteRule /2(.*) /index.php/2$1 [L]RewriteRule /action(.*) /index.php/action$1 [L]

이 규칙은 정식 버전 1.1을 기준으로 작성되었습니다. 문제가 있다면 아래 댓글로 알려 주세요.

댓글

(2)
  1. Chrome 81 Windows 10

    谢谢你的帮助,现在我也设置好了伪静态,可以改网址了

댓글 작성