一般情况下,wordpress博客系统使用windows系统的服务器主机设置的固定链接的结构中,会多出/index.php/部分,如https://www.boke8.net/index.php/1.html形式,这样结构的URL无论是在美观或SEO方面都让人感觉到不友好,不过可以通过简单的方法去掉index.php。
wordpress去掉index.php的方法步骤:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | [ISAPI_Rewrite] # 3600 = 1 hour CacheClockRate 3600 RepeatLimit 32 # Protect httpd.ini and httpd.parse.errors files # from accessing through HTTP # Rules to ensure that normal content gets through RewriteRule /sitemap.xml /sitemap.xml [L] RewriteRule /favicon.ico /favicon.ico [L] # For file-based wordpress content (i.e. theme), admin, etc. RewriteRule /wp-(.*) /wp-$1 [L] # For normal wordpress content, via index.php RewriteRule ^/$ /index.php [L] RewriteRule /(.*) /index.php/$1 [L] |
PS:使用wordpress程序还是推荐使用Linux系统的主机