| | |||||
| ||||||||
| Webmaster Tutorials Instructional webmaster-related how-to's and tutorials. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| I'll do it ![]() Join Date: Dec 2005 Location: India
Posts: 6,939
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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. ????: NamePros.com http://www.namepros.com/webmaster-tutorials/372675-redirecting-sitename-to-www-sitename.html This will only work on apache servers with mod_rewrite enabled.
__________________
Last edited by -Nick-; 10-06-2007 at 01:41 AM.
|
| |
| | #3 (permalink) |
| Danltn.com Join Date: May 2007 Location: Danltn.com / Nottingham, UK
Posts: 1,201
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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.
|
| |
| | #4 (permalink) |
| NamePros Regular Join Date: Aug 2006 Location: NE
Posts: 455
![]() ![]() ![]() ![]() ![]() ![]() | Thanks worked like a charm!
__________________ :camera: Talk Stangs.com-Lets Talk about Stangs! :o 225 and LPX .US bzet .com oqpj .com -Offer through PM- |
| |
| | #7 (permalink) | ||||
| goof free! Join Date: Mar 2006 Location: Canada
Posts: 9,359
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
????: NamePros.com http://www.namepros.com/showthread.php?t=372675 It means if you type in sitename.com it takes you to www.sitename.com | ||||
| |
| | #8 (permalink) |
| NamePros Member Join Date: Oct 2007
Posts: 51
![]() | By the way, I heard, that Google like website which are redicting from http:// to http://www. I mean, it help with PageRank. |
| |
| | #9 (permalink) | ||||
| Danltn.com Join Date: May 2007 Location: Danltn.com / Nottingham, UK
Posts: 1,201
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Never had proof of that. Could you tell me where you found this information?
__________________ | ||||
| |
| | #10 (permalink) | ||||
| Traveller Join Date: Mar 2007 Location: Yet another city
Posts: 1,419
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Matt Cutts suggests it's a good idea:
__________________ NameCooler.com | ||||
| |
| | #11 (permalink) | ||||||||
| Danltn.com Join Date: May 2007 Location: Danltn.com / Nottingham, UK
Posts: 1,201
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
__________________ | ||||||||
| |
| | #12 (permalink) |
| Senior Member Join Date: Jan 2006
Posts: 2,356
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | are there any other ways of doing this as its not working for my site www.7dl.com resolves, 7dl.com doesnt
__________________ Y5S.com for sale - PM mepoker blog |
| |
| | #13 (permalink) |
| i love automation Join Date: Nov 2007 Location: xrvel.com
Posts: 1,615
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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
__________________ |
| |
| | #14 (permalink) |
| NamePros Regular Join Date: Nov 2006 Location: Fishin Screen!
Posts: 958
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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] |
| |
| | #15 (permalink) | ||||
| goof free! Join Date: Mar 2006 Location: Canada
Posts: 9,359
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
????: NamePros.com http://www.namepros.com/showthread.php?t=372675 on a new line in your .htaccess right after what you posted above. | ||||
| |
| | #17 (permalink) |
| NamePros Regular Join Date: Nov 2006 Location: Fishin Screen!
Posts: 958
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | [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] ????: NamePros.com http://www.namepros.com/showthread.php?t=372675 ill try
__________________ Cheap SEO Article Services <-- Great Deals on Opening, try it now! |
| |
| | #18 (permalink) | ||||
| Senior Member Join Date: Aug 2006 Location: Little place around the World
Posts: 1,711
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Thanks
__________________ When Its a BREAND dont need others. Value Technologies CouponFor.Me - Best and fresh Coupons Strong Directory - Free Play | ||||
| |
| | #20 (permalink) |
| New Member Join Date: Apr 2008
Posts: 13
![]() | 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.
__________________ webkinz recipes recipe for cake recipes, chicken recipes, cookie recipes, bread recipes, kids recipes, food free guitar tabs, lessons wii-bundle |
| |
| | THREAD STARTER #21 (permalink) |
| I'll do it ![]() Join Date: Dec 2005 Location: India
Posts: 6,939
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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
__________________ |
| |