对于学建站新手,推荐刚开始使用wordpress程序学习做网站,由于wordpress是PHP编程语言,它与LINUX空间配合很好,但仍有很多做网站新手会购买到windows属性空间,就导致了安装wordpress程序之后,伪静态出现链接中含有index.php的情况。(相关知识:网站伪静态规则)
去除链接中的index.php有二个方法:
一个是使用WORDPRESS插件; 另一种是使用纯代码修改。下面讲讲如何使用无插件纯代码方式去除网站链接中的index.php。
首先桌面新建一个txt文本,然后复制以下代码至txt文件中:# 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]标签: