...

View Full Version : My page only displays correctly with www. infront =(



crank01
02-24-2011, 11:44 PM
:confused: Hello, my webpage only displays correctly when I have www. in front of my domain name. Without the www. it'll have no favicon, the background is no longer full screen. I put my homepage in index.html, do I suppose to do something to default.html? I am a complete noob lol, please help me fix this problem.

If you need to know what webhost I have its, hostgator. Thankyou :thumbsup:

gcaweb
02-25-2011, 12:09 AM
You could put an .htaccess file in the folder that has the index.html file in it. This would would force the browser to always have a www in thr url

Crean an .htaccess file with the folowing and replace website.com with your domain name:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.website.com$
RewriteRule ^(.*)$ http://www.website.com/$1 [R=301]

This is what I do for my domain at www.gocreateawebsite.com (http://www.gocreateawebsite.com)

crank01
02-25-2011, 12:15 AM
Ok thanks man, I'll will try that and tell you after how it goes :thumbsup:

crank01
02-25-2011, 12:18 AM
Wait it says I can't create a file called that bcuz theres already an .htaccess file :confused: I cant even find it tho. I was trying to make a file in the /public_html folder btw.

EDit: Nvm I found it, I had to view the hidden pages also. =S lol alright now let me test it if it will work.

crank01
02-25-2011, 12:25 AM
:thumbsup: Works really nicely thanks man. Do you happen to know what might have been the problem as to why it was only showing the favicon and background for "www."? Just curious as to why it would mess up with the www



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum