现在公司重新做了一个网站,以前的新闻部整合到了新网站里面,但以前的旧新闻链接要保留,并且点击旧新闻的时候要指向新的网站,这个要怎么做,需要配置.htaccess吗?
是的,配置302转向
是的,配置302转向
这个具体怎么设置呢?
比如:旧网站:http://www.zh123.com/salaryandcareertips/2034/detail/
新网站:http://news.zh123.com/news-2034/
2032是id的话
salaryandcareertips\/(0-9+)\/detail\/ news-$1/
RewriteRule salaryandcareertips\/(0-9+)\/detail\/ news-$1/ [L,R=301]
RewriteRule salaryandcareertips\/(0-9+)\/detail\/ news-$1/ [L,R=301]
好的,谢谢,我星期六试试
RewriteRule salaryandcareertips\/(0-9+)\/detail\/ news-$1/ [L,R=301]
我在我们网站里面发现了.htaccess文件,里面有一些
RewriteRule ^heighlights/([0-9]+)/([a-zA-Z0-9_]+)/$ /modules/heighlights/heighlight-details.php?id=$1&pagetype=$2 [QSA,L]
#RewriteRule ^employer/([0-9]+)/([a-zA-Z0-9_]+)-detail/$ /modules/employers/employer-details.php?id=$1&pagetype=$2 [QSA,L]
这2句是什么意思?
简单点就是: /modules/heighlights/heighlight-details.php?id=1&pagetype=2 这样的链接
重写为:heighlights/1/2
/modules/employers/employer-details.php?id=1&pagetype=2
重写为:employer/1/2
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号