Typecho伪静态去除/index/

写在

先来几张去掉后的效果图

1.文章页面
TIM截图20190804142908.jpg

2.独立页面
TIM截图20190804142916.jpg

3.分类页面
TIM截图20190804142922.jpg

嗯,去掉后是不是感觉link变得简洁了好多。

下面是配置文件

nginx 配置

server {
        listen          80;
        server_name     yourdomain.com;
        root            /home/yourdomain/www/;
        index           index.html index.htm index.php;

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

        location ~ .*\.php(\/.*)*$ {
            include fastcgi.conf;
            fastcgi_pass  127.0.0.1:9000;
        }

        access_log logs/yourdomain.log combined;
    }

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>

后台处理

配置完服务器后还有在后台永久链接那儿将自定义文章路径改成WordPress类型
然后使用地址重写功能保存设置即可啦。


评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注