.htaccess 永久重定向

分享到: 更多
By admin, 2009年09月24日

当网站的结构变更的时候,须要地原来的目录会子域名做重定向转向

用.htaccess的Redirect语句可以轻松实现:
Redirect语句,使用很简单:

Redirect /旧目录/旧文档名 新文档的地址
或者
Redirect 旧目录 新目录

举个例子,假如我现在要把http://www.cmszs.com/lwl0606这个目录转移到http://www.heznan.com/lwl0606,那么我们只需要在.htaccess文件中写入以下内容并上传到http://www.cmszs.com的网站根目录即可。
Redirect /blog http://www.heznan.com/blog
这样,所有对http://www.cmszs.com/blog目录的请求都将被重新指向新的站点,包括附加的额外URL信息。例如有人访问
http://www.cmszs.com/blog/index.html
就会被重定向到
http://www.heznan.com/blog/index.html

相关日志

.htaccess用法注意事项小结
Discuz论坛伪静态.htaccess怎么写
linux主机.htaccess文件如何设置图片防盗链

随机文章

2010年9月godaddy优惠码(持续更新中)
GoDaddy的windows主机信任级别medium
godaddy的windows主机运行WordPress报500错误:500 - Internal server error
pdfdo注册码,pdfdo破解版
IP和域名正则表达式
利用谷歌关键字工具进行GOOGLE关键词分析
could not load the assembly 'app_web_' Make sure that it is compiled before accessing the page
揭露一个冒充雅虎的骗子网站:http://cn.yahoo.com.txqq.me
支持网页版SKYPE,MSN,YAHOO,GOOGLE TALK多种聊天的网页imo.im
Google AdSense申请成功的经验总结

Comments are closed