就是http://www.fhss.com.cn/exmobi.php 跳转到http://www.fhss.com.cn/exmobi.htm
http://www.fhss.com.cn/solution.php 跳转到http://www.fhss.com.cn/soluti.htm这种
希望有人可以给点经验,百度的那些有点开不动,希望解答如何编写
PHP重定向通常使用.htaccess
htaccess可以帮我们实现包括:文件夹密码保护、用户自动重定向、自定义错误页面、改变你的文件扩展名、封禁特定IP地址的用户、只允许特定IP地址的用户、禁止目录列表,以及使用其他文件作为index文件等一些功能。
实现举例
RewriteEngine OnRewriteBase /
# Rewrite 系统规则请勿修改
RewriteCond %{HTTP_HOST} http://www.fhss.com.cn/exmobi.php/$ [NC]
RewriteRule ^(.*)$ http://www.fhss.com.cn/exmobi.htm/$1 [R=301,L]
RewriteCond %{HTTP_HOST} http://www.fhss.com.cn/solution.php/$ [NC]
RewriteRule ^(.*)$ http://www.fhss.com.cn/soluti.htm/$1 [R=301,L]
#php转 htm
RewriteRule ^/exmobi([0-9]+)+\.htm$ /exmobi.php?aid=$1
RewriteRule ^/solution([0-9]+)+\.htm$ /solution.php ?aid=$1
温馨提示:答案为网友推荐,仅供参考
第1个回答 2014-10-16
header()函数啊。header("location:url")追问
header("location:主页url还是栏目页url?")
本回答被网友采纳