Typecho程序伪静态规则大全

image

地址重写功能伪静态

Apache

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>

Nginx

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

IIS

[ISAPI_Rewrite]
CacheClockRate 3600
RepeatLimit 32
RewriteRule /tag/(.*) /index\.php\?tag=$1
RewriteRule /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]

强制https

Apache

RewriteEngine on
 RewriteBase /
 RewriteCond %{SERVER_PORT} !^443$
 RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]

Nginx

if ($scheme = http ) {
return 301 https://$host$request_uri;
}
Last modification:August 31st, 2018 at 09:06 am
If you think my article is useful to you, please feel free to appreciate

Leave a Comment