天天看点

Typecho 在Apache中开启伪静态

Apache中如果没有开启伪静态模块,需要手动开启。

sudo ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load             

复制

然后修改

/etc/apache2/sites-available/

中默认的配置文件,搜索其中的

AllowOverride None

,全部改为

AllowOverride All

,然后重启Apache,

service apache2 restart

然后在网站根目录下添加.htaccess 文件,内容如下:

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]           

复制