网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 休闲娱乐 > 闲话灌水
User Name
Password
 
FAQ Members List Calendar Cheap Glasses Mark Forums Read

闲话灌水 追逐时尚话题,共度开心时刻,体会生活点滴,分享精彩人生。

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   IP: 222.184.47.229
Old 2009-02-20, 06:03 PM
topvip topvip is offline
超级版主
 
Join Date: 2006-01-04
Posts: 1206
topvip 正向着好的方向发展
Default wordpress静态化设置:windows主机(服务器)伪静态去除index.php方法

你只需创建一个404错误页面,并且写入下列4行代码即可简单优雅的实现无插件完美支持windows iis主机的永久固定链接的伪静态化地址格式。去掉网页地址中的index.php!

Code:
<?php
$qs = $_SERVER['QUERY_STRING'];
$_SERVER['REQUEST_URI'] = substr($qs, strpos($qs, ':80')+3);
$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
include('index.php');
?>
这样即可固定REQUEST_URI和PATH_INFO参量并且包括进去index.php,剩下的将交给wordpress完成任务(说实话,这参数定义代码偶也不清楚,依葫芦画瓢即可)。

具体设置步骤:
1.新建一个记事本,在里面写入上面代码,保存,连同txt格式重新命名为wp-404-handler.php。
2.设置404自定义错误指向wp-404-handler.php,一般来说,绝大多数服务器控制面板均提供该选项。
3.进入wordpress管理后台,设置(Options)-永久链接(Permalinks),你就当自己的主机是linux主机使好了,任意、随便设置自己喜欢的伪静态地址格式及静态地址后缀。
推荐链接地址层次不要太深,并且伪静态化地址加上html/htm,不过也有人推荐不要加上伪静态后缀,因为那样搜索引擎可能会认为那种地址是一个分类目录,而不是一个具体的网页,从而获得更高的搜索排名权重,现在wordpress个人博客也比较流行那种伪静态格式。

不管怎样,你成功去掉了index.php!
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 01:54 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.