网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 服务器与数据库 > 服务器环境搭建
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

服务器环境搭建 Windows,Linux,IIS,Apache等服务器配置、安全维护以及PHP和MYSQL运行环境讨论。

Reply
 
Thread Tools Display Modes
  #1   IP: 218.2.67.78
Old 2006-01-17, 12:10 PM
sunshine sunshine is offline
高级会员
 
Join Date: 2006-01-05
Posts: 368
sunshine 正向着好的方向发展
Default Apache Rewrite技术(PHPWIND)

把你的PHP的动态页面映射成HTML的静态页面,这个HTML页面是不存在的,只不过当访问1.HTML的时候,服务器就会把1.HTML映射到1.PHP上!
Rewrite 很简单的说,就是把类似
==> /phpbb2/viewtopic.php?t=1388&start=0
动态网页,转成
==> /phpbb2/viewtopic-1388-0.html
好处有:
1. URL 短一点,静态网址的接受度较高。
2. Search Engine 比较吃的下去~
3. 静态的网址会有比较好的 SE-BENCHMARK

首先要看看你的空间是否支持REWRITE
看看探针就可以了!http://www.0058.net/iprober.php?act=phpinfo

url_rewriter.tags a=href,area=href,frame=src,form=,fieldset= a=href,area=href,frame=src,form=,fieldset=
如果有的话
恭喜
请继续跟我来
写一个
.htaccess
文件
内容是:
RewriteEngine on
RewriteRule k([0-9]+).html$ read.php?tid=$1
RewriteRule k([0-9]+).html$ read.php?tid=$1&fpage=$2
RewriteRule t([0-9]+).html$ thread.php?fid=$1
RewriteRule p([0-9]+).html$ post.php?fid=$1
RewriteRule p1([0-9]+).html$ post.php?action=vote&fid=$1
RewriteRule index.html$ index.php
RewriteRule iprober.html$ iprober.php
只针对PHPWIND
其他的PHP地址请自己写
这样就已经被映射好了
解释一下,第一个是你的版块地址
第二个是你的帖子地址!
明白了吗?
不明白?
再看,还不明白?还看^^^
测试一下!
www.0058.net/index.php
www.0058.net/index.html


http://www.0058.net/t40.html
http://www.0058.net/thread.php?fid=40&page=

http://www.0058.net/k7423.html
http://www.0058.net/read.php?tid=7423

然后就是修改你的PHPWIND连接了
主要是摸板,很容易啊!
比如说index.html
在TEMPLATE/WIND

然后把
<a href='thread.php?fid=$forums[fid]' TARGET=_blank><img src='$imgpath/$stylepath/$forums[pic].gif' border=0></a></td>


替换成
<a href='t$forums[fid].html' TARGET=_blank><img src='$imgpath/$stylepath/$forums[pic].gif' border=0></a></td>


<a href='thread.php?fid=$forums[fid]' TARGET=_blank>$forums[llogo]</a>
<a href='thread.php?fid=$forums[fid]' class='fnamecolor'>

<a href='t$forums[fid].html' TARGET=_blank>$forums[llogo]</a>
<a href='t$forums[fid].html' class='fnamecolor'>

Last edited by sunshine : 2006-01-18 at 04:26 PM
Reply With Quote
Reply


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

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 10:54 AM.


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