[advanced search]
Next Live Event: NamePros Live Auction, May 23rd at 6PM EDT
Results from the May 8th live auction are here.
18 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Webmaster Tutorials
User Name
Password

Old 09-10-2007, 11:46 PM   · #1
-Nick-
I'll do it
 
-Nick-'s Avatar
 
Name: Keral. Patel.
Location: India
Trader Rating: (95)
Join Date: Dec 2005
Posts: 4,578
NP$: 13696.40 (Donate)
-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute
Member of the Month
September 2007 Adoption
Redirecting sitename to www.sitename

Redirecting your sitename.com to www.sitename.com with help of .htaccess

Create a .htaccess file or add the code to an existing one on your server.

If you are creating a new .htaccess file make sure it is in the root folder of the site.

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^sitename.com [nc]
rewriterule ^(.*)$ http://www.sitename.com/$1 [r=301,nc]

Where sitename.com and www.sitename.com will be replaced by your original details of the site itself.

This will only work on apache servers with mod_rewrite enabled.


Please register or log-in into NamePros to hide ads

Last edited by -Nick- : 10-06-2007 at 01:41 AM.
-Nick- is offline   Reply With Quote
Old 09-11-2007, 02:05 AM   · #2
Tobiasz
NamePros Member
 
Tobiasz's Avatar
 
Trader Rating: (2)
Join Date: Aug 2007
Posts: 73
NP$: 100.00 (Donate)
Tobiasz is an unknown quantity at this point
And last but not least - do not forget about last empty line (just hit Enter after last line of code twice)
__________________
I'm buying Polish domains (Polish words + any TLD and all names + .pl).

Got domains? Make a PROFIT!

Register ALL TLDs in one place.
Tobiasz is offline   Reply With Quote
Old 09-11-2007, 04:38 AM   · #3
Daniel
Danltn.com
 
Daniel's Avatar
 
Name: Daniel Neville
Location: Danltn.com / Nottingham, UK
Trader Rating: (65)
Join Date: May 2007
Posts: 1,162
NP$: 638.56 (Donate)
Daniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond repute
Ethan Allen Fund Ethan Allen Fund
The alternative rule:

Code:
Options +FollowSymlinks RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.site\.us$ [NC] RewriteRule ^(.*)$ http://site.us/$1 [R=301,L]

Last edited by Danltn : 10-08-2007 at 08:56 AM.
Daniel is offline   Reply With Quote
Old 09-23-2007, 06:51 AM   · #4
blatant
DNOA Member
 
blatant's Avatar
 
Location: NE
Trader Rating: (22)
Join Date: Aug 2006
Posts: 416
NP$: 37.70 (Donate)
blatant is just really niceblatant is just really niceblatant is just really niceblatant is just really niceblatant is just really nice
Thanks worked like a charm!
__________________
Talk Stangs.com-Lets Talk about Stangs!
225 and LPX .US bzet .com oqpj .com
-Offer through PM-
blatant is offline  
  Reply With Quote
Old 10-05-2007, 06:44 AM   · #5
Etab
Resident Naysayer
 
Etab's Avatar
 
Name: Steve
Location: Lehigh Valley, PA
Trader Rating: (52)
Join Date: Jan 2006
Posts: 3,034
NP$: 2943.76 (Donate)
Etab has a brilliant futureEtab has a brilliant futureEtab has a brilliant futureEtab has a brilliant futureEtab has a brilliant futureEtab has a brilliant futureEtab has a brilliant futureEtab has a brilliant futureEtab has a brilliant futureEtab has a brilliant futureEtab has a brilliant future
Ethan Allen Fund Ethan Allen Fund Cancer Survivorship VA Tech Memorial Special Olympics
Thanks, Nick. I've been too lazy to dig up this code.
Etab is offline  
  Reply With Quote
Old 10-12-2007, 01:51 AM   · #6
Waiter
NamePros Member
 
Waiter's Avatar
 
Trader Rating: (0)
Join Date: Jan 2007
Posts: 130
NP$: 0.00 (Donate)
Waiter is an unknown quantity at this point
So does it mean if I type sitename in brouther it redirects you to sitemname.com? I have seen such situations, but I thought it is google.
Waiter is offline   Reply With Quote
Old 10-12-2007, 01:53 AM   · #7
mis_chiff
Senior Member
 
mis_chiff's Avatar
 
Trader Rating: (24)
Join Date: Mar 2006
Posts: 3,951
NP$: 411.00 (Donate)
mis_chiff has a reputation beyond reputemis_chiff has a reputation beyond reputemis_chiff has a reputation beyond reputemis_chiff has a reputation beyond reputemis_chiff has a reputation beyond reputemis_chiff has a reputation beyond reputemis_chiff has a reputation beyond reputemis_chiff has a reputation beyond reputemis_chiff has a reputation beyond reputemis_chiff has a reputation beyond reputemis_chiff has a reputation beyond repute
Member of the Month
November 2007 Save a Life VA Tech Memorial Breast Cancer
Originally Posted by Waiter
So does it mean if I type sitename in brouther it redirects you to sitemname.com? I have seen such situations, but I thought it is google.




It means if you type in sitename.com it
takes you to www.sitename.com

__________________
Signatures should be no more than FOUR lines in length and may not contain
images or fonts larger than Size 2
.
mis_chiff is online now   Reply With Quote
Old 10-20-2007, 12:11 PM   · #8
Pointer
NamePros Member
 
Trader Rating: (1)
Join Date: Oct 2007
Posts: 51
NP$: 119.00 (Donate)
Pointer is an unknown quantity at this point
By the way,
I heard, that Google like website which are redicting from http:// to http://www.
I mean, it help with PageRank.
Pointer is offline   Reply With Quote
Old 10-20-2007, 01:13 PM   · #9
Daniel
Danltn.com
 
Daniel's Avatar
 
Name: Daniel Neville
Location: Danltn.com / Nottingham, UK
Trader Rating: (65)
Join Date: May 2007
Posts: 1,162
NP$: 638.56 (Donate)
Daniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond repute
Ethan Allen Fund Ethan Allen Fund
Originally Posted by Pointer
By the way,
I heard, that Google like website which are redicting from http:// to http://www.
I mean, it help with PageRank.



Never heard of that.
Never had proof of that.

Could you tell me where you found this information?
Daniel is offline   Reply With Quote
Old 10-20-2007, 04:35 PM   · #10
-NC-
Stranger
 
-NC-'s Avatar
 
Location: in a strange land
Trader Rating: (34)
Join Date: Mar 2007
Posts: 1,230
NP$: 769.28 (Donate)
-NC- has much to be proud of-NC- has much to be proud of-NC- has much to be proud of-NC- has much to be proud of-NC- has much to be proud of-NC- has much to be proud of-NC- has much to be proud of-NC- has much to be proud of-NC- has much to be proud of
Animal Cruelty Animal Rescue Ethan Allen Fund
Matt Cutts suggests it's a good idea:

Quote:
You can make your webserver so that if someone requests http://example.com/, it does a 301 (permanent) redirect to http://www.example.com/. That helps Google know which url you prefer

http://www.mattcutts.com/blog/seo-a...nonicalization/
-NC- is offline  
  Reply With Quote
Old 10-27-2007, 01:27 AM   · #11
Daniel
Danltn.com
 
Daniel's Avatar
 
Name: Daniel Neville
Location: Danltn.com / Nottingham, UK
Trader Rating: (65)
Join Date: May 2007
Posts: 1,162
NP$: 638.56 (Donate)
Daniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond reputeDaniel has a reputation beyond repute
Ethan Allen Fund Ethan Allen Fund
Originally Posted by -NC-
Matt Cutts suggests it's a good idea:

Quote:
You can make your webserver so that if someone requests http://example.com/, it does a 301 (permanent) redirect to http://www.example.com/. That helps Google know which url you prefer

http://www.mattcutts.com/blog/seo-a...nonicalization/



He doesnt' say either is better, he says Google learns your preference.
Daniel is offline   Reply With Quote
Old 10-27-2007, 04:43 PM   · #12
irishmat
Senior Member
 
Trader Rating: (74)
Join Date: Jan 2006
Posts: 2,171
NP$: 116.00 (Donate)
irishmat has much to be proud ofirishmat has much to be proud ofirishmat has much to be proud ofirishmat has much to be proud ofirishmat has much to be proud ofirishmat has much to be proud ofirishmat has much to be proud ofirishmat has much to be proud ofirishmat has much to be proud of
are there any other ways of doing this as its not working for my site

www.7dl.com resolves, 7dl.com doesnt
irishmat is offline  
  Reply With Quote
Old 12-05-2007, 05:40 AM   · #13
xrvel
xrvel is cruel :-)
 
xrvel's Avatar
 
Name: Kurniawan
Location: Indonesia
Trader Rating: (17)
Join Date: Nov 2007
Posts: 779
NP$: 2682.31 (Donate)
xrvel is a name known to allxrvel is a name known to allxrvel is a name known to allxrvel is a name known to allxrvel is a name known to allxrvel is a name known to all
I have default .htaccess :
Code:
# -FrontPage- IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* <Limit GET POST> order deny,allow deny from all allow from all </Limit> <Limit PUT DELETE> order deny,allow deny from all </Limit> AuthName www.{mydomain}.com AuthUserFile /home/iwantw/public_html/_vti_pvt/service.pwd AuthGroupFile /home/iwantw/public_html/_vti_pvt/service.grp


Where should i add the add-on htaccess code?
__________________
Domain Name Generator | (how to)
xrvel is offline   Reply With Quote
Old 12-09-2007, 11:27 PM   · #14
umat_gila
NamePros Regular
 
Trader Rating: (1)
Join Date: Nov 2006
Posts: 262
NP$: 32.00 (Donate)
umat_gila is on a distinguished road
am i know why i must directing ?
and because as i can see there some people just prefer to http://domain and some people have choose http://www.domain so, which one the best ?
and if i want to use http://domain is it right the code off httacsess
Code:
Options +FollowSymlinks RewriteEngine on RewriteCond %{HTTP_HOST} ^\.site\.us$ [NC] RewriteRule ^(.*)$ http://site.us/$1 [R=301,L]


regards
umat_gila is offline   Reply With Quote
Old 12-09-2007, 11:35 PM   · #15
mis_chiff
Senior Member
 
mis_chiff's Avatar
 
Trader Rating: (24)
Join Date: Mar 2006
Posts: 3,951
NP$: 411.00 (Donate)
mis_chiff has a reputation beyond reputemis_chiff has a reputation beyond reputemis_chiff has a reputation beyond reputemis_chiff has a reputation beyond reputemis_chiff has a reputation beyond reputemis_chiff has a reputation beyond reputemis_chiff has a reputation beyond reputemis_chiff has a reputation beyond reputemis_chiff has a reputation beyond reputemis_chiff has a reputation beyond reputemis_chiff has a reputation beyond repute
Member of the Month
November 2007 Save a Life VA Tech Memorial Breast Cancer
Originally Posted by xrvel
I have default .htaccess :
Code:
# -FrontPage- IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* <Limit GET POST> order deny,allow deny from all allow from all </Limit> <Limit PUT DELETE> order deny,allow deny from all </Limit> AuthName www.{mydomain}.com AuthUserFile /home/iwantw/public_html/_vti_pvt/service.pwd AuthGroupFile /home/iwantw/public_html/_vti_pvt/service.grp


Where should i add the add-on htaccess code?



Add the code umat_gila pasted above,
on a new line in your .htaccess right after what you posted above.
__________________
Signatures should be no more than FOUR lines in length and may not contain
images or fonts larger than Size 2
.
mis_chiff is online now   Reply With Quote
Old 12-10-2007, 01:20 AM   · #16
xrvel
xrvel is cruel :-)
 
xrvel's Avatar
 
Name: Kurniawan
Location: Indonesia
Trader Rating: (17)
Join Date: Nov 2007
Posts: 779
NP$: 2682.31 (Donate)
xrvel is a name known to allxrvel is a name known to allxrvel is a name known to allxrvel is a name known to allxrvel is a name known to allxrvel is a name known to all
Originally Posted by mis_chiff
Add the code umat_gila pasted above,
on a new line in your .htaccess right after what you posted above.

Thanks. it works
__________________
Domain Name Generator | (how to)
xrvel is offline   Reply With Quote
Old 12-12-2007, 01:43 PM   · #17
umat_gila
NamePros Regular
 
Trader Rating: (1)
Join Date: Nov 2006
Posts: 262
NP$: 32.00 (Donate)
umat_gila is on a distinguished road
[QUOTE=xrvel]I have default .htaccess :
Code:
# -FrontPage- IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* <Limit GET POST> order deny,allow deny from all allow from all </Limit> <Limit PUT DELETE> order deny,allow deny from all </Limit> AuthName www.{mydomain}.com AuthUserFile /home/iwantw/public_html/_vti_pvt/service.pwd AuthGroupFile /home/iwantw/public_html/_vti_pvt/service.grp Options +FollowSymlinks RewriteEngine on RewriteCond %{HTTP_HOST} ^\.site\.us$ [NC] RewriteRule ^(.*)$ http://site.us/$1 [R=301,L]


thats the conclusion right ?
ill try
umat_gila is offline   Reply With Quote
Old 04-22-2008, 01:35 AM   · #18
trsaso
Senior Member
 
trsaso's Avatar
 
Name: Saso
Location: Little place around the World
Trader Rating: (33)
Join Date: Aug 2006
Posts: 1,126
NP$: 361.75 (Donate)
trsaso is a name known to alltrsaso is a name known to alltrsaso is a name known to alltrsaso is a name known to alltrsaso is a name known to alltrsaso is a name known to all
Originally Posted by -Nick-
Redirecting your sitename.com to www.sitename.com with help of .htaccess

Create a .htaccess file or add the code to an existing one on your server.

If you are creating a new .htaccess file make sure it is in the root folder of the site.

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^sitename.com [nc]
rewriterule ^(.*)$ http://www.sitename.com/$1 [r=301,nc]

Where sitename.com and www.sitename.com will be replaced by your original details of the site itself.

This will only work on apache servers with mod_rewrite enabled.



Tested on my site and working wery well , rep+
Thanks
trsaso is offline   Reply With Quote
Old 04-22-2008, 03:26 AM   · #19
-Nick-
I'll do it
 
-Nick-'s Avatar
 
Name: Keral. Patel.
Location: India
Trader Rating: (95)
Join Date: Dec 2005
Posts: 4,578
NP$: 13696.40 (Donate)
-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute
Member of the Month
September 2007 Adoption
Thanks I am much happy that it helped you all. It is this that always inspires me to write stuff
-Nick- is offline   Reply With Quote
Old 04-28-2008, 10:19 AM   · #20
trampy
New Member
 
Trader Rating: (0)
Join Date: Apr 2008
Posts: 11
NP$: 0.00 (Donate)
trampy is an unknown quantity at this point
The reason why you might do this for google or any other search engine is that there is a limit as to how many characters the crawler recognizes in the url. So if you have a long url with a lot of keywords in it the loss of the www gives you three extra characters.

I think limit is like 255 characters typically which is a lot, but if you have some script generating your page names it could happen.
__________________
recipe for cake recipes, chicken recipes, cookie recipes, bread recipes, kids recipes, food
free guitar tabs, lessons
wii-bundle
disney movies
trampy is offline   Reply With Quote
Old 04-28-2008, 02:26 PM   · #21
-Nick-
I'll do it
 
-Nick-'s Avatar
 
Name: Keral. Patel.
Location: India
Trader Rating: (95)
Join Date: Dec 2005
Posts: 4,578
NP$: 13696.40 (Donate)
-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute-Nick- has a reputation beyond repute
Member of the Month
September 2007 Adoption
That's a good suggestion trampy

Will keep it in mind whenever there is a situation like this. But it rarely comes. Yet it might be beneficial for someone

Thanks for posting it
-Nick- is offline   Reply With Quote
Reply

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump