win环境下,测试不了伪静态? 环境:win apache 放了.htaccess ,设置了httpd.cofig等,伪静态就是不成功.首页的伪静态链接已经生成,点进去都是"not found" 404(也就是说程序不能解析伪静态化后的url,.htaccess里的伪静态规则没有生效) 用phpinfo()函数查看了,重写模块已加载.有在win环境下配置好伪静态测试环境的同志帮忙提示一下,100分相赠 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是"not found" 404(也就是说程序不能解析伪静态化后的url应该是你的.htaccess里的规则没写好. 你需要从什么情况改成什么情况?你的.htaccess是怎么写的?然后大家才好帮助你。 想不到大家都怀疑.htaccess里有问题.这个是没有问题的呀,在我的服务器里正常运行.只是说在本机不行,主要是设置问题我想下面还是帖上吧:RewriteEngine OnRewriteRule ^(.*)/(list|bencandy)-([^\.]+)\.([a-zA-Z0-9]+)$ $1/$2\.php\?stringID=$3RewriteRule ^(.*)/([A-Z])([^\/]+)/([^\/]+)/f([^\/]+)\.([a-zA-Z0-9]+)$ $1/$2$3/bencandy\.php\?Fid=$4&Id=$5RewriteRule ^(.*)/([A-Z])([^\/]+)/([^\/]+)/([^\/]+)/$ $1/$2$3/list\.php\?Fid=$5&zone_street=$4RewriteRule ^(.*)/([A-Z])([^\/]+)/([^\/]+)/$ $1/$2$3/list\.php\?Fid=$4RewriteRule ^(.*)/post.htm$ $1/post\.phpRewriteRule ^(.*)/post-([0-9]+)-([0-9]+)\.htm$ $1/post\.php\?fid=$2&city_id=$3RewriteRule ^(.*)/post-edit-([0-9]+)-([0-9]+)\.htm$ $1/post\.php\?job=edit&fid=$2&id=$3RewriteRule ^(.*)/post-del-([0-9]+)-([0-9]+)\.htm$ $1/post\.php\?action=del&fid=$2&id=$3 .htacess 我的也是伪静态ydtuiguang.com规则先写好,代码替换URL为规则里的格式RewriteEngine On#RewriteBase /# direct one-word accessRewriteRule ^index\.html$ index\.php [L]RewriteRule ^tg([0-9]+)p([0-9]+)\.html$ column\.php?cid=$1&page=$2 [QSA,L]代码就要写$html = str_replace('index.php', 'index.html', $html);$html = preg_replace("/\"column.php\?cid=(\d+)&id=(\d+)&page=(\d+)/i", "\"tg$1id$2p$3.html", $html); 一个php的小问题。 初学php 猎头职位-PHP工程师-杭州 Fatal error: Call to undefined function curl_init() 死活解决不了 求vn700等各大高手!求助PHP正则! 为何method=post时无法读取变量和数组的值? 菜鸟求救!! php结合javascript的小问题!立即结贴 推陈出新~SmartIPB论坛放出,顶者有分 总在if语句运行不了!请帮忙看看! 查询和插入功能! 跪求php功能代码 提交订单并用sendmail发送到邮箱从数据库读出的是乱码
你的.htaccess是怎么写的?然后大家才好帮助你。
想不到大家都怀疑.htaccess里有问题.这个是没有问题的呀,在我的服务器里正常运行.只是说在本机不行,主要是设置问题我想下面还是帖上吧:RewriteEngine OnRewriteRule ^(.*)/(list|bencandy)-([^\.]+)\.([a-zA-Z0-9]+)$ $1/$2\.php\?stringID=$3
RewriteRule ^(.*)/([A-Z])([^\/]+)/([^\/]+)/f([^\/]+)\.([a-zA-Z0-9]+)$ $1/$2$3/bencandy\.php\?Fid=$4&Id=$5
RewriteRule ^(.*)/([A-Z])([^\/]+)/([^\/]+)/([^\/]+)/$ $1/$2$3/list\.php\?Fid=$5&zone_street=$4
RewriteRule ^(.*)/([A-Z])([^\/]+)/([^\/]+)/$ $1/$2$3/list\.php\?Fid=$4
RewriteRule ^(.*)/post.htm$ $1/post\.php
RewriteRule ^(.*)/post-([0-9]+)-([0-9]+)\.htm$ $1/post\.php\?fid=$2&city_id=$3
RewriteRule ^(.*)/post-edit-([0-9]+)-([0-9]+)\.htm$ $1/post\.php\?job=edit&fid=$2&id=$3
RewriteRule ^(.*)/post-del-([0-9]+)-([0-9]+)\.htm$ $1/post\.php\?action=del&fid=$2&id=$3
规则先写好,代码替换URL为规则里的格式
RewriteEngine On
#RewriteBase /
# direct one-word access
RewriteRule ^index\.html$ index\.php [L]
RewriteRule ^tg([0-9]+)p([0-9]+)\.html$ column\.php?cid=$1&page=$2 [QSA,L]
代码就要写
$html = str_replace('index.php', 'index.html', $html);
$html = preg_replace("/\"column.php\?cid=(\d+)&id=(\d+)&page=(\d+)/i", "\"tg$1id$2p$3.html", $html);