homepage Welcome to WebmasterWorld Guest from 54.205.144.54
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
subdomain and KWs postion
domain and subdomain?
webon




msg:1523049
 2:50 am on Jul 18, 2004 (gmt 0)

hello, currently , i am setting up my server. and i would like to have 2 subdomain
names, which is mean
1. www.domainname.com

2. kw1.domainname.com

3. kw1.domainname.com

but my question here is what is different between

www.domainname.com/kw1/ and kw1.domainname.com?

the second one will take more advanatage from that?

and usually i put the robots.txt under the root directory,
but if i have the subdomain, do i need to also copy the same
robots.txt file to different root?

thanks

 

jdMorgan




msg:1523050
 3:31 am on Jul 18, 2004 (gmt 0)

webon,

This is priarily an SEO question, and you might get better advice asking in the forums pertaining to the search engines you are interested in, but I'll have a go anyway:

> but my question here is what is different between www.domainname.com/kw1/ and kw1.domainname.com?

Probably nothing.

> the second one will take more advanatage from that?

I doubt it.

> and usually i put the robots.txt under the root directory, but if i have the subdomain, do i need to also copy the same robots.txt file to different root?

That depends on how you set up the subdomains. If you set up the subdomains in their own virtual servers, then you'll need a separate robots.txt for each (or you could symlink them). If you point all the subdomains to the same virtual server, and then use mod_rewrite to rewrite requests for each subdomain to a subdirectory under your main domain, then you would put a copy of robots.txt in that subdirectory as well. Or, you could check for requests for robots.txt, and *not* rewrite those requests, using the "main" robots.txt for all subdomains.

The benefit of keyword-in-domain is very small; it is a minor factor in about 100 factors used to rank your pages. However, if you have essentially-identical content on these three domains, then you run the risk of a "duplicate-content penalty." While some here think of it as a penalty, the main effect seems to be that the search engines will pick one of your domains to list, and ignore the others. I would humbly suggest, if these domains are essentially identical, that you spend your time on creating good content that will make others want to link to you, and seek out good incoming links from site on related topics that will want to offer their visitors the benefit of your content. If you can get them to use a few of your keywords naturally in the link-text of their links to you, that will help a lot more than putting your keyword in the URL. Stick with one domain, and get all of your incoming links pointed to that one, instead of diluting them across three domains.

Jim

webon




msg:1523051
 4:06 am on Jul 18, 2004 (gmt 0)

jim

thank you for the reply. it helps a lot. and i agree with you that the content is the king.

and i have some another questions regarding the mod_rewrite on apache.

PS: currently i have switch the hosting from windows to unix, and will use php and mysql for my site.

1. how can i use mod_rewrite the url with .html extension from .php? by just add the code on .htaccess will do the whole work? can i have some samples here?

for example:

www.domainname.com/fold1/product.php?id=product-name&type=10

should rewrite to
www.domainname.com/fold1/product-name_10.html

by the way, here is a sample link which has high ranking on SE, do you think this is the result of mod_rewrite?

<snip>

2. If i can use the way mod_rewrite to mask the urls and display as .html, they will have the same impact on search engines compare with the real .html page on server? which way will be better i use php to generate the html on the fly or just simply use .htaccess to do the mod_rewrite thing?

i know it seems a little be out of topic, but please help me out.

thanks a lot in advance.

Ross

[edited by: jdMorgan at 2:58 pm (utc) on July 18, 2004]
[edit reason] Removed URL per TOS [/edit]

jdMorgan




msg:1523052
 3:25 pm on Jul 18, 2004 (gmt 0)

> 1. how can i use mod_rewrite the url with .html extension from .php? by just add the code on .htaccess will do the whole work? can i have some samples here?

> for example, www.domainname.com/fold1/product.php?id=product-name&type=10 should rewrite to www.domainname.com/fold1/product-name_10.html

Actually, from your description of your problem, you probably want to rewrite the other way, from a static link (published on your pages) to a dynamic URL (used by your script). Mod_rewrite works after an HTTP request is received, but before any content handlers are invoked on the server, so it rewrites *incoming* URLs to the URLs needed inside your server. Mod_rewrite cannot change the links on your pages as they are served.

Samples here? Sure, do a search [google.com].

> by the way, here is a sample link which has high ranking on SE, do you think this is the result of mod_rewrite?
<snip>

Please review the WebmasterWorld Terms of service [webmasterworld.com] and our charter [webmasterworld.com].

> 2. If i can use the way mod_rewrite to mask the urls and display as .html, they will have the same impact on search engines compare with the real .html page on server? which way will be better i use php to generate the html on the fly or just simply use .htaccess to do the mod_rewrite thing?

The usual approach is to publish static-URL links on your Web pages, and use mod_rewrite to convert those links, when requested, into the form needed to invoke your script. So, your pages have links on them like
www.example.com/hotel/sunset.html, but your script is invoked using URLs like www.example.com/index.php?accom=hotel&location=sunset

If you use this method, then as far as users and search engines are concerned, your URLs are static - there is no way they can see the underlying technology of how your server creates and serves pages. For example, look at the URL in your browser address bar right now. It appears to be a static page on WebmasterWorld, but this site is actually dynamic.

Please study the following documentation. These resources will help you get started, and give you the knowledge needed to discuss this project, understand the issues, and implement and maintain a good solution:

Apache mod_rewrite documentation [httpd.apache.org]
Apache URL Rewriting Guide [httpd.apache.org]
Regular Expressions Tutorial [etext.lib.virginia.edu]

Jim

webon




msg:1523053
 5:44 pm on Jul 18, 2004 (gmt 0)

thank you very much.

Ross

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved