开发者

Is there a way to force traffic comin from www.abc.com to go to abc.com via htaccess or dns?

I am having some trouble with a flash file that has hardcoded urls in it. The flash loads fine if I visit f开发者_JAVA百科rom abc.com. But if I try to view it from www.abc.com it wont load.

So my question is, how do I got about forcing all traffic, including that coming from www.abc.com to be directed to abc.com instead.


This is what I use, in conjunction with apache's mod_rewrite module. It's domain-agnostic.

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]


Yes. Look into mod_alias if you're running Apache, which I'll assume because you talk about .htaccess. A directive similar to

RedirectMatch http://www.abc.com(.*)$ http://abc.com$1

might do some good.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜