euroiplayer Posted October 29, 2006 Share Posted October 29, 2006 Hi all :)I got a problem, with my host. I have a free sub-domain, everything works fine and I like it... but there is one problem.When people visit my website with '[b]www[/b]' or '[b]http://www[/b]' my hosts website appears. The URL in the browser doesn't change, it stays the same with my sub-domain. The only way you can visit my website (sub-domain) is only with '[b]http://[/b]' and no other way.Example:www.mysub-domain.host.com ([b][color=red]NOT WORKING[/color] - hosts website appears[/b])http://mysub-domain.host.com ([b][color=green]WORKING[/color] - my sub-domain appears[/b])http://www.mysub-domain.host.com ([b][color=red]NOT WORKING[/color] - hosts website appears[/b])I emailed the host why this is happening and this is what I got:[quote][b]ME:[/b]Hello,Can you please tell me why isn't http://www or www isn't working?Thanks[b]HOST:[/b]Hi there ,the www is actually a sub-domain / in its own right , and is unnecessary additional keystrokes .please have a look at[b]http://no-www.org/[/b][b]ME:[/b]Hello,I truly agree with the no www. But is there anyway you can redirect fromhttp://www or www. to my site http://subdomain.phpnet.us instead ofhttp://phpnet.us ? This website has everything and I am truly happy withit, but I just need to get this little problem fixed as many people stillinclude www before typing the address, therefore they will see that mywebsite is supposedly down when in fact not.Is there any way I can write something in the .htaccess file that wouldredirect to my website?Thank You.[b]HOST:[/b]Unfortunately the 'www' is actually a sub domain off the hosting servers , with our homepage on ...[/quote]I visited the website I was provided by the host, http://no-www.org/ and on the website I found out a code where you could add it to .htaccess file, and it would make '[b]www[/b]' and '[b]http://www[/b]' redirect.Here is the code:[code]RewriteEngine OnRewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L][/code]So now since my host gave me that* website to go to find more info. I assume hes using that code in .htaccess file.[b]NOW[/b] since I provided you with all the info above, is there anyway to bypass all of that* and make '[b]www[/b]' and '[b]http://www[/b]' work (make them show my website instead of my hosts?If you got any other questions feel free to ask... thanks alot.INFO: Host is http://www.phpnet.us/Here is a picture too of what is happening to make myself more clear.1. My hosts website.2. When I visit my sub-domain website with http://sub-domain.host.com works fine.3. When I visit my sub-domain with www.sub-domain.host.com doesn't work, my hosts website appears.4. When I visit my sub-domain with http://www.sub-domain.host.com doesn't work, my hosts website appears.[img]http://img158.imageshack.us/img158/6393/explanationhttpwwwgn5.jpg[/img] Quote Link to comment https://forums.phpfreaks.com/topic/25524-htaccess-help-please-www-or-httpwww-not-working/ Share on other sites More sharing options...
Ninjakreborn Posted December 13, 2006 Share Posted December 13, 2006 I advice you to find another host. Something. For instance you can find hosts for really cheap, you can't really get much of what you want on a free webhost. Quote Link to comment https://forums.phpfreaks.com/topic/25524-htaccess-help-please-www-or-httpwww-not-working/#findComment-140370 Share on other sites More sharing options...
redbullmarky Posted December 13, 2006 Share Posted December 13, 2006 the htaccess file goes inside of the directory containing the file where the initial request is being made. so to use the htaccess you showed above, you'd need to put this either in the directory served by www, or even lower - and i'd bet my left nad on the fact that you dont have this type of access.busi is right though. if your website is worth enough to you, there a plenty of hosts out there that for only a couple of £ a month will host it, coupled with a domain name of your own. you cant really expect much out of a free host apart from restrictions and/or adverts.cheersMark Quote Link to comment https://forums.phpfreaks.com/topic/25524-htaccess-help-please-www-or-httpwww-not-working/#findComment-140383 Share on other sites More sharing options...
steviewdr Posted December 13, 2006 Share Posted December 13, 2006 Its a DNS (domain name service) feature!"www.website.com" can be a totally different server to "website.com"You can try this yourself. Type into the START -> RUN box:ping www.website.comandping website.comThey would have to add a seperate www DNS subdomain to your existing. They dont seem to want to do that by the sounds of it.www's at the start of a URL are going out of fashion anyways, and are not needed.Basically - there is nothing you can do with a htaccess file.You can BUY your own domain name and then you can do what you like. It'll only cost $11 a year - pennies!-steve Quote Link to comment https://forums.phpfreaks.com/topic/25524-htaccess-help-please-www-or-httpwww-not-working/#findComment-140393 Share on other sites More sharing options...
Ninjakreborn Posted December 13, 2006 Share Posted December 13, 2006 [quote]www's at the start of a URL are going out of fashion anyways, and are not needed.[/quote]I disagree with that one part. If you notice 95% Literally, 95% of the people who use hte internet ALWAYS put www.whatever.whatever.It's very rare someone will actually remember to do for instance freelancebusinessman.comIt's highly unlikely that someone would type the actual name then .com, everyone is use to www and it will probably always be that way. 99% of the time you check a website, you can check how there dns is setup, 90% of the time it always has to have the www.Like php freaks, I haven;t tried but htey probably have it where you can do phpfreaks.com and it might work.If you go around trying some sites, some sites do, but most of them don't, it's not something "I feel" is going to go out of style for a bunch of years. Quote Link to comment https://forums.phpfreaks.com/topic/25524-htaccess-help-please-www-or-httpwww-not-working/#findComment-140447 Share on other sites More sharing options...
steelmanronald06 Posted December 13, 2006 Share Posted December 13, 2006 i just type in the domain and the TDL. I also notice alot of people at my campus, at home, and at work doing the same thing. WWW is not really needed, and sometimes will take you to a different site as is the problem here. Leaving it off saves typing and always gets you where your going. an exception, of course, is school websites:http://carlalbert.edu will take you to the OneNet who hosts our domain so we have to use http://www.carlalbert.edu Quote Link to comment https://forums.phpfreaks.com/topic/25524-htaccess-help-please-www-or-httpwww-not-working/#findComment-140513 Share on other sites More sharing options...
zq29 Posted December 13, 2006 Share Posted December 13, 2006 I never type the www. either - Although I have noticed a very small amount of websites that require it, which, oddly enough is the case with the websites for some major retail chains here in the UK.I never advertise my domains with the www. prepended to them either. It's a waste of keystrokes / inefficient use of time - Those milliseconds add up, don't you know! Quote Link to comment https://forums.phpfreaks.com/topic/25524-htaccess-help-please-www-or-httpwww-not-working/#findComment-140524 Share on other sites More sharing options...
wildteen88 Posted December 13, 2006 Share Posted December 13, 2006 If you have a sub domain setup then you dont prepend www to the url at all. You only add www when you are not using a subdomain with your TLD. normal url for access a website with no sub-domain:www.mysite.com -- real-life example http://www.google.comif you have a subdomain, then you swap www. with your actual subdomainmy-subdomain.mysite.com -- real-life example http://video.goole.com Quote Link to comment https://forums.phpfreaks.com/topic/25524-htaccess-help-please-www-or-httpwww-not-working/#findComment-140538 Share on other sites More sharing options...
neylitalo Posted December 14, 2006 Share Posted December 14, 2006 [quote author=wildteen88 link=topic=113166.msg484209#msg484209 date=1166035450]If you have a sub domain setup then you dont prepend www to the url at all.[/quote]Only if you have DNS set up that way. ;) You can have DNS accept www.subdomain.domain.com if you want - it's just kinda un-standard practice. Quote Link to comment https://forums.phpfreaks.com/topic/25524-htaccess-help-please-www-or-httpwww-not-working/#findComment-140908 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.