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

Typecho后台设置永久链接后,会在域名后加上index.php,就比如我之前那篇文章

https://oxxx.cn/index.php/archives/6.html

强迫症表示真的很难受 ̄﹃ ̄
在网上找了很多教程,其中很多都是说在.htaccess里面加上下面的伪静态代码并且在后台永久链接里面设置使用地址重写功能:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>

微信截图_20180324231935.webp
微信截图_20180324231935.webp

但是,我之前遇到过问题,可能是我这边的主机问题吧,开启地址重写功能后index.php并没有去掉,并且网站只能进入首页,点击文章显示500错误,今天终于把500错误的问题解决了,只要在伪静态下面添加下面的代码就可以解决启用地址重写500错误的问题:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-httpd-php application/x-javascript
# END

规则貌似的借用了wordpress的,只要能解决问题就成୧(๑•̀⌄•́๑)૭,如果有和我相同问题的不妨试一试哦

SurGarfield
作者:Garfield
主页:点击访问
SurGarfield
作者:MinJoan
主页:点击访问
打赏 0 分享
评论(2)
隐私评论
  1. Hmm is anyone else encountering problems with the pictures on this blog loading?
    I'm trying to determine if its a problem on my end or if it's the blog.
    Any feedback would be greatly appreciated.

    2020年05月30日回复
  2. Kudos, Fantastic stuff!

    2019年02月15日回复