Jump to content


Photo

.htaccess help please [ www or http://www not working]


  • Please log in to reply
8 replies to this topic

#1 euroiplayer

euroiplayer
  • Members
  • PipPip
  • Member
  • 27 posts

Posted 29 October 2006 - 10:07 PM

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 'www' or 'http://www' 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 'http://' and no other way.
Example:
www.mysub-domain.host.com (NOT WORKING - hosts website appears)
http://mysub-domain.host.com (WORKING - my sub-domain appears)
http://www.mysub-domain.host.com (NOT WORKING - hosts website appears)

I emailed the host why this is happening and this is what I got:

ME:
Hello,
Can you please tell me why isn't http://www or www isn't working?

Thanks

HOST:
Hi there ,

the www is actually a sub-domain /  in its own right , and is unnecessary additional keystrokes .

please have a look at

http://no-www.org/

ME:
Hello,
I truly agree with the no www. But is there anyway you can redirect from
http://www or www. to my site http://subdomain.phpnet.us instead of
http://phpnet.us ?  This website has everything and I am truly happy with
it, but I just need to get this little problem fixed as many people still
include www before typing the address, therefore they will see that my
website is supposedly down when in fact not.

Is there any way I can write something in the .htaccess file that would
redirect to my website?

Thank You.

HOST:
Unfortunately the 'www' is actually a sub domain off the hosting servers , with our homepage on ...


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 'www' and 'http://www' redirect.

Here is the code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]

So now since my host gave me that* website to go to find more info. I assume hes using that code in .htaccess file.

NOW since I provided you with all the info above, is there anyway to bypass all of that* and make 'www' and 'http://www' 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.
Posted Image



#2 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 13 December 2006 - 01:37 PM

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.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#3 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 13 December 2006 - 01:50 PM

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.

cheers
Mark
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#4 steviewdr

steviewdr
  • Moderators
  • Advanced Member
  • 1,364 posts
  • LocationIreland

Posted 13 December 2006 - 02:10 PM

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.com
and
ping website.com

They 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

#5 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 13 December 2006 - 03:49 PM

www's at the start of a URL are going out of fashion anyways, and are not needed.

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.com
It'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.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#6 steelmanronald06

steelmanronald06
  • Staff Alumni
  • Advanced Member
  • 2,004 posts
  • LocationOk

Posted 13 December 2006 - 05:51 PM

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

#7 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 13 December 2006 - 06:10 PM

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!

#8 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 13 December 2006 - 06:44 PM

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.com

if you have a subdomain, then you swap www. with your actual subdomain

my-subdomain.mysite.com -- real-life example http://video.goole.com

#9 neylitalo

neylitalo
  • Staff Alumni
  • Advanced Member
  • 1,854 posts
  • LocationMichigan, USA

Posted 14 December 2006 - 05:28 AM

If you have a sub domain setup then you dont prepend www to the url at all.


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.
http://nealylitalo.net - My personal website, and home of The Netizen's Journal.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users