600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > typecho 隐藏index.php Typecho开启伪静态并隐藏index.php

typecho 隐藏index.php Typecho开启伪静态并隐藏index.php

时间:2023-09-18 07:37:22

相关推荐

typecho 隐藏index.php Typecho开启伪静态并隐藏index.php

Typecho开启伪静态并隐藏index.php

灵曦• 年 07 月 21 日

前言

Typecho后台设置永久链接后,会在域名后加上index.php,贼不好看

那么我们如何做到这样的效果?

教程

1.后台配置typecho伪静态

如图,在typecho后台,开启伪静态,并选择你喜好的url形式:

2.配置服务器的rewrite规则

如果在保存上述配置的时候,typecho无法自动配置,那么你可能需要手动配置服务器的rewrite规则。

nginx配置server {

listen 80;

server_name ;

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配置

RewriteEngine On

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

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

版权属于:灵曦

本站文章采用 知识共享署名4.0 国际许可协议 进行许可,请在转载时注明出处及本声明!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。