Forum Moderators: phranque

Message Too Old, No Replies

New to .htaccess

I have several questions about URL structures

         

virtuals

6:38 pm on Jun 1, 2005 (gmt 0)

10+ Year Member



Hello I found this wonderful forum through google search.
I have several questions:

1- I want don’t want any one specially search engines access my site with out "www". So if they go to [mysite.com...] they get the page [mysite.com....] (I think this will help my rank and search results. Is it true? )

2- Is there any difference between [mysite.com...] and [mysite.com...]

3- Which one is better? [sub.mysite.com...] or [sub.mysite.com?...]

4- I have got some sub domains. I want when some one goes to my sub domain to be redirected to the folder matching the sub domain. Sub1.mysite.com to mysite.com/sub1. I need this because I sow each sub domain has its own rank so I think if they be redirected to folders this helps the main site's rank is it so?

I know I'm new and you may just feel not to answer a newcomer with several questions, but hope I can get my answers here. =)

jdMorgan

7:06 pm on Jun 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



virtuals,

Welcome to WebmasterWorld!

1- I want do not want any one specially search engines access my site with out "www". So if they go to http://example.com they get the page http://www.example.com. (I think this will help my rank and search results. Is it true? )

See this recent thread [webmasterworld.com] for current discussion. See our forum charter [webmasterworld.com] for more information and links to basic resources.

Declaring a single canonical name for your site helps to prevent other webmasters from linking to the incorrect domain name, and helps to prevent search engines being confused and listing the wrong domain name or splitting your rank across the two domain names and thus penalizing you for 'duplicate content.'

2- Is there any difference between http://www.example.com and http://www.example.com/

http://www.example.com/ is correct. This is a request for the index or index page of the site at http://www.example.com/

3- Which one is better? [sub.example.com...] or [sub.example.com?<...]
This is your choice. Usually, shorter is better -- it's easier to type.

4- I have got some sub domains. I want when some one goes to my sub domain to be redirected to the folder matching the sub domain. Sub1.mysite.com to mysite.com/sub1. I need this because I sow each sub domain has its own rank so I think if they be redirected to folders this helps the main site's rank is it so?

This is largely a site maintenance subject. It is easier to maintain the sites if their pages are kept in separate directories. See this recent thread [webmasterworld.com] for related discussion.

Jim

virtuals

7:56 pm on Jun 1, 2005 (gmt 0)

10+ Year Member



2- so is a .htaccess file necessary (or any good) to convert http://www.example.com to http://www.example.com/?
dose this help search engines and site's rank?

jdMorgan

9:00 pm on Jun 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Normally, the server will do the rewrite automatically. See Apache mod_dir [httpd.apache.org].

It is doubtful that this will help your search engine ranking in itself. But it is always better to be entirely consistent when linking. Use only one domain per site. Use only one URL per page, image, etc.

Jim

virtuals

8:33 pm on Jun 4, 2005 (gmt 0)

10+ Year Member



Which one is more logical?
Are they the same?

1-
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST}!^www\.example\.com
RewriteRule (.*) [www....] example.com/$1 [R=301,L]

2-
RewriteCond %{HTTP_HOST} ^ example.com$ [NC]
RewriteRule ^(.*)$ [www....] example.com/$1 [R=301,L]

jdMorgan

8:50 pm on Jun 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



1) Redirect all except blank and www domain to www domain. (Blank detect to prevent fatal problem with HTTP/1.0 clients.)

2) Redirect only non-www domain to www domain.

Jim

virtuals

9:28 pm on Jun 4, 2005 (gmt 0)

10+ Year Member



would you please explane a bit about the fatal problem?