views:

50

answers:

2

I am having some trouble with a flash file that has hardcoded urls in it. The flash loads fine if I visit from 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.

+1  A: 

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.

calmh
so which method is better or more appropriate? Or does it matter?
Roeland
Both will work. Use whichever one you're more comfortable with.
ceejayoz
+4  A: 

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]
zombat
i think i will end up using this one since i can use this code regardless of what the domain is. thanks
Roeland