2010-12-13, 06:26 PM
This will be an interesting question/challenge to anybody well-versed in the use of apache mod_rewrite on linux servers.
Background:
It is necessary for you to read this to understand the nature of my problem, goal, and question. I have heavily researched this topic before posting this thread (as heavily as possible for a newbie). On the type of server I use, you can not add a "www" prefix to a subdomain and you also can not use a-names or c-names to handle redirection via dns manager in the control panel. I have researched it EXTENSIVELY, if you want both sub.domain.com and www .sub.domain.com to point to the same directory, you must make two distinct subdomains both pointing to your content. Enter duplicate content problems...
-----------------------------------------------------
Goal:
My goal is for users to be able to search for or enter both the "www" and the "non-www" subdomain addresses into their browsers and be directed to my content. My fear is that because most people instinctively enter the www prefix before all addresses that users will think my content doesn't exist. So, since I am stuck with two distinct subdomains, I need a way to redirect all traffic to only one or risk duplicate content penalties.
-----------------------------------------------------
Directory Layout:
/domain/chat/index.html (subdomain #1)
/domain/non-www-chat/index.html (subdomain #2)
Both of these directories contain the exact same index.html page, which is nothing more than a simple html document using a 100% x 100% frame to link to a xat chatroom. The purpose is that members don't have to remember a long and convoluted address, they can simply go to chat . mysite . com.
-----------------------------------------------------
Current Setup:
The way I have it set up now, it is functioning perfectly and I really don't care about duplicate content issues as I have no concern with a chatroom being indexed by search engines, lol. However, as I continue to add content and subdomains, I will undoubtedly have to use this method again of creating both a "www" subdomain and a "non-www" subdomain to get the users to the same content.
------------------------------------------------------
The Million Dollar Question: How can I use .htaccess and url redirection to make users who type "subdomain.domain.com" into their browsers be automatically redirected to "www.subdomain.domain.com" ?????
(I have researched and tried several different angles with .htaccess unsuccessfully, although it seems this would have to be possible, I simply don't possess the skills to make it happen)
Background:
It is necessary for you to read this to understand the nature of my problem, goal, and question. I have heavily researched this topic before posting this thread (as heavily as possible for a newbie). On the type of server I use, you can not add a "www" prefix to a subdomain and you also can not use a-names or c-names to handle redirection via dns manager in the control panel. I have researched it EXTENSIVELY, if you want both sub.domain.com and www .sub.domain.com to point to the same directory, you must make two distinct subdomains both pointing to your content. Enter duplicate content problems...
-----------------------------------------------------
Goal:
My goal is for users to be able to search for or enter both the "www" and the "non-www" subdomain addresses into their browsers and be directed to my content. My fear is that because most people instinctively enter the www prefix before all addresses that users will think my content doesn't exist. So, since I am stuck with two distinct subdomains, I need a way to redirect all traffic to only one or risk duplicate content penalties.
-----------------------------------------------------
Directory Layout:
/domain/chat/index.html (subdomain #1)
/domain/non-www-chat/index.html (subdomain #2)
Both of these directories contain the exact same index.html page, which is nothing more than a simple html document using a 100% x 100% frame to link to a xat chatroom. The purpose is that members don't have to remember a long and convoluted address, they can simply go to chat . mysite . com.
-----------------------------------------------------
Current Setup:
The way I have it set up now, it is functioning perfectly and I really don't care about duplicate content issues as I have no concern with a chatroom being indexed by search engines, lol. However, as I continue to add content and subdomains, I will undoubtedly have to use this method again of creating both a "www" subdomain and a "non-www" subdomain to get the users to the same content.
------------------------------------------------------
The Million Dollar Question: How can I use .htaccess and url redirection to make users who type "subdomain.domain.com" into their browsers be automatically redirected to "www.subdomain.domain.com" ?????
(I have researched and tried several different angles with .htaccess unsuccessfully, although it seems this would have to be possible, I simply don't possess the skills to make it happen)