typecho开启伪静态

在Typecho后台设置中开启 地址重写功能

然后在.htaccess文件中加上如下

1
2
3
4
5
6
7
8
9
10
11
12
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]

</IfModule>

在apache2中开启.htaccess功能
在apahce2的000-default.conf中将需要应用.htaccess的目录下的AllowOverride属性改为All保存即可

1
2
3
<Directory />
AllowOverride All
</Directory>