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

Typecho后台设置永久链接后,会在域名后加上index.php,很多人都接受不了。例如如下网址:http://www.landui.com/index.php/archives/37/

但我们希望最终的形式是这样:http://www.landui.com/archives/37.html

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

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

nginx配置server {

listen          80;

server_name     landui.com;

root            /home/landui/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/landui.log combined;

}

如果还有问题,请参考:http://docs.typecho.org/servers?s%5B%5D=nginx

apache配置

RewriteEngine On

RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

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

此配置可以放在apache的conf文件中,或者放在.htaccess中。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值