PDA

View Full Version : disallowing WWW in the URL.. How can I do this?


Sedativechunk
04-14-2007, 12:27 PM
On my site, my header consist of a flash banner. The URL is here: www.thegamehog.com

Originally, I had all the sections of the site (previews, reviews, etc.) as sub-domains, but after a sandbox type error, I found that the flash banner does not work with anything in front of the sites URL. It must show up as http://thegamehog.com/whatever. If the www shows up in the URL, like www.thegamehog.com or http://www.thegamehog.com, the flash banner will not work.

My question is, is there a way I can block the www part of the URL using htaccess or re-direct it when it does?

When I link from page to page using anchor tags it works fine, but with the flash, it will always put the http://www in the URL even though in the flash I have it set to http:// with no www. I could really use from help with this, and yes, I did some personal research and I used htaccess re-directs on my last site. But if I re-direct the URL and its technically the same URL, wouldn't the page just keep reloading over and over again? Or I can use a META redirect I was just thinking, but I don't know how this would work.
Note, the flash banner will work with stuff in the URL when using Opera or if you are just lucky, but the majority of my visitors testing out the site so far said they cannot get it to work at all, including me, so I want to just rid the WWW all together if possible.

GarrettW
05-22-2007, 12:07 AM
yep, try this.
insert this line only if it does not currently exist in the file:RewriteEngine on
and then do these 2 lines:
RewriteCond %{HTTP_HOST} ^www\.thegamehog\.com$ [NC]
RewriteRule ^(.*)$ http://thegamehog.com/$1 [R=301,L]

and as far as your flash thing, how are you linking the buttons: are you using the Behaviors pane or writing in the ActionScript manually? cuz the Behaviors deal might be inserting a "www" without you knowing it. just an idea though.