发布网友
共3个回答
热心网友
你用的是主机屋的win主机吗?
如果是,方法如下
1、新建一个httpd.ini文件,将以下代码放添加进去,放在根目录下。
[ISAPI_Rewrite]
# Defend your computer from some worm attacks
#RewriteRule .*(?:global.asa|default\.ida|root\.exe|\.\.).* . [F,I,O]
# 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 /tag/(.*) /index\.php\?tag=$1
RewriteRule /software-files/(.*) /software-files/$1 [L]
RewriteRule /images/(.*) /images/$1 [L]
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]
2、新建一个txt文本,将以下代码内容添加进去,然后另存为404.php。
<?php
$qs = $_SERVER['QUERY_STRING'];
$_SERVER['REQUEST_URI'] = substr($qs, strpos($qs, ‘:80′)+3);
$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
include(‘index.php’);
?>
3、进入wordpress后台,重新设置固定链接,保存即可。
要提醒一下,这个方法不能完全搞定所有问题,在这里要再次提醒一下各位玩WordPress的朋友,WordPress是PHP语言的程序,请使用linux主机与其搭配,win主机虽然也支持php,但完全没有linux支持的好,也会避免很多不必要的问题!!
热心网友
如果是win主机
如果是,方法如下
1、新建一个httpd.ini文件,将以下代码放添加进去,放在根目录下。
[ISAPI_Rewrite]
# Defend your computer from some worm attacks
#RewriteRule .*(?:global.asa|default\.ida|root\.exe|\.\.).* . [F,I,O]
# 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 /tag/(.*) /index\.php\?tag=$1
RewriteRule /software-files/(.*) /software-files/$1 [L]
RewriteRule /images/(.*) /images/$1 [L]
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]
2、新建一个txt文本,将以下代码内容添加进去,然后另存为404.php。
<?php
$qs = $_SERVER['QUERY_STRING'];
$_SERVER['REQUEST_URI'] = substr($qs, strpos($qs, ‘:80′)+3);
$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
include(‘index.php’);
?>
3、进入wordpress后台,重新设置固定链接,保存即可。
要提醒一下,这个方法不能完全搞定所有问题,在这里要再次提醒一下各位玩WordPress的朋友,WordPress是PHP语言的程序,请使用linux主机与其搭配,win主机虽然也支持php,但完全没有linux支持的好,也会避免很多不必要的问题!!
热心网友
可以用伪静态插件。不过根据百度新的规则,动态网站反而会有更高权重