网络营销电子商务研究中心  
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运行环境讨论。

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   IP: 82.116.154.18
Old 2009-01-05, 04:51 PM
topvip topvip is offline
超级版主
 
Join Date: 2006-01-04
Posts: 1206
topvip 正向着好的方向发展
Default Php伪静态页问题!

果用PHP生成HTML那就难更新!

生成伪静态的话,用Apache的MOD Rewrite方法不太可靠,因为服务器不是我的,大多数服务器是别人的。有可能开有可能不开。

有可能 是LINUX也有可能是WIND。

那么我只有用别的方法找到了一个方法,来自互联网;
Code:
function mod_rewrite(){
     global $_GET;
     $nav=$_SERVER["REQUEST_URI"];
     $script_name=$_SERVER["SCRIPT_NAME"];
     $nav=substr(ereg_replace("^$script_name","",urldecode($nav)),1);
     $nav=preg_replace("/^.ht(m){1}(l){0,1}$/","",$nav);//这句是去掉尾部的.html或.htm
     $vars = explode("/",$nav);
     for($i=0;$i<Count($vars);$i+=2){
          $_GET["$vars[$i]"]=$vars[$i+1];
     }
     return $_GET;
}
我能看明白,但是我不知道如何调用!

比如讲我的网址:www.xxx.com/index.php

以上是首页,那么我访问www.xxx.com/xx-xx-xx.html这个时候没有 这个页面就会出错或者转向404页!

郁闷!我有点笨,不知道怎么写了。如果是:

www.xxx.com/index.php?xx-xx-xx.html这就太明显了!

请问有没有人做过?给个例子!谢谢!
Reply With Quote
 


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:39 PM.


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