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>
但是,我之前遇到过问题,可能是我这边的主机问题吧,开启地址重写功能后index.php并没有去掉,并且网站只能进入首页,点击文章显示500错误,今天终于把500错误的问题解决了,只要在伪静态下面添加下面的代码就可以解决启用地址重写500错误的问题:
RewriteEngine OnRewriteBase /RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]# BEGIN WordPressRewriteEngine OnRewriteBase /RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-httpd-php application/x-javascript# END规则貌似的借用了wordpress的,只要能解决问题就成୧(๑•̀⌄•́๑)૭,如果有和我相同问题的不妨试一试哦