如何使用htaccess将http://example.com替换为http://www.example.com [英] how to replace http://example.com with http://www.example.com using htaccess

查看:122
本文介绍了如何使用htaccess将http://example.com替换为http://www.example.com的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想重写这样的网址,当某个类型http://example.com自动替换为http://www.example.com

时,有人可以告诉我一些我应该在.htacess中使用代码以实现我的目的。

I want to rewrite the URL such that, when some one type http://example.com it automatically replaced with http://www.example.com
can some one tell me what code should i use in .htacess so achieve my purpose.

推荐答案

查看 Apache重写指南 [ ^ ] - 您要求的是页面上的第一个示例。
Check out the Apache rewriting guide[^] - what you are asking for is one of the first examples on the page.


它在apache程序员手册中有很好的文档...请找到它在下面...





http://httpd.apache.org/docs/2.0/misc/rewriteguide.html [ ^ ]





标记为答案if解决了你问题,它的动机是:)
it is very well documented in apache programmer mannual... kindly find it below...


http://httpd.apache.org/docs/2.0/misc/rewriteguide.html[^]


mark as answer if solves your problem, it motivates :)


这篇关于如何使用htaccess将http://example.com替换为http://www.example.com的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆