View Full Version : diff with www and without www
penth
02-26-2006, 04:11 PM
new to 1and1 with beginner shared hosting. the problem is, after changed the forum directory, the access location from differed while access with www.mysite.com and mysite.com the forum was supposely set to forum.mysite.com now it changed to mysite.com/forum.php but now, access with www.mysite.com it goes to the dir: www.mysite.com/index.php but with mysite.com it goes to www.mysite.com/forum.php . how can i fix this so that they both go to a same directory? thx in advance.
eWebtricity
02-27-2006, 07:39 AM
This sounds like a DNS forwarding or redirect problem. What's the domain name so we can actually see what it's doing? What 1and1 product is this on (root server, managed, etc ...)?
Highland
02-27-2006, 10:42 AM
I'm not sure I fully understand but to clarify
1. www.domain.com and domain.com are seen as separate sites. It's a good idea to 301 one to the other. What you will need is a .htaccess file fix this. Make a new text file and name it .htaccess (Windows will warn you when you try to do this but ignore it) and put the following inside
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.domain\.com
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
What this does is tell Apache that any call to http://domain.com should be forwarded to the www version of that page. This makes search engines happy.
2. A subdomain (ie forum.domain.com) is an entirely different issue. Subdomains don't just go away on their own so your site can't just mysteriously move from forum.domain.com to domain.com/forum.php
If you're using one of the 1and1 hosting packages (ie not a dedicated server) you'll need to make the subdomain through the admin control panel. I would create a new folder in the root of your FTP and then use the control panel to make a subdomain and point it there.
penth
02-27-2006, 04:52 PM
thnx but the method you provide isn't working, or i might not know how to use it, and there is a .htaccess file already set there how can i add your code in addition to that, the site was a 1 and 1 domain at shared hosting domain was waveclan.net
Highland
02-28-2006, 12:10 PM
Did you edit it for your domain first?
You should be able to append that code to your existing htaccess file without problems.
penth
02-28-2006, 05:53 PM
there is another .htaccess file at that the root directory of that domain so in what way should i addd those codes? i tried to parse it directly by skiped a line and replaced http://www.domain.com/ to my domain, it doesn't work, i can't even go to my site the page isn't able to display, and i also tried to changed them around to replace the ./domain/ and so on, what is the exact way to change it? can you define it a bit futher? thx for your help.
Highland
03-01-2006, 10:55 AM
Just use either a plain text editor (Notepad) or use one of the SSH editors (vi or pico). The .htaccess file is typically invisible to FTP but it's there
As to what it should look like I'll use waveclan.net
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.waveclan\.net
RewriteRule (.*) http://www.waveclan.net/$1 [R=301,L]
vBulletin® v3.7.0 Beta 4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.