Tips On Using SubDomain
Published: Sunday, March 14, 2004
Points to consider before using subdomains Subdomain makes the URLs shorter and nicer. It allows website owners to categorize the content of the website. It also helps in improving the search engine rankings as most of the search engines treat the subdomain as a separate website address. However, there are certain things to consider before setting up subdomains for your website. - Many web hosting providers do not provide subdomains in their hosting packages. If you have subdomain and want to move your site, you have to choose one which supports subdomains.
- Most web hosts charge extra for subdomain setup and maintenance.
- If you use cookies in your website, a cookie set from a subdomain cannot be read from the main domain and vice versa because of the security association feature tied to the domain which set it. This is also true for session cookies, where, if the user is logged in on the main site, and then moves to a subdomain, the subdomain site will not be able to access the same session cookie, and will assign a new session (hence forcing the user
to login again). However, session persistence across subdomains can be maintained by implementing URL rewriting instead of session cookies.
- Your website stats will often not include the statistics of the subdomains. Therefore, you have to setup separate statistics for your subdomains.
- One of the advantages of using subdomain is that the website can be broken down into smaller pieces without losing the brand image associated with the domain name. The subdomains can be hosted on separate servers in order to reduce the burden on the main domain hosting server.
Sharing cookies among all subdomains As explained earlier, cookies are not shared among subdomains or between the domain and the subdomain. In order to set cookies accessible by all subdomains, use the following techniques: - While writing the cookie, set the cookie domain to ".domain.ext" so that it applies to all subdomains.
- If the cookie domain is set to ".domain.ext", it will not be accessible by a user who types in the address without the www before the domain (i.e. http://domain.ext). Therefore, redirect all requests without www to http://www.domain.ext.
There are some reported problems with the above approach. It is safe to set the default cookie with no domain specified and then set another one with domain as ".domain.ext". In this case there is no need for the redirects. However, remember that session cookies are set by the web server software and you may not have control over how the cookie domain is set.
|
 |
|
 |
|
|
|
RELATED NEWS
|
 |
Web.com Launches Two New Features for AI-Powered Domain Name and Website Content Creation
New AI offerings from one-stop web solutions provider designed to help small businesses thrive throughout the website buildin...
|
 |
PRIDE365(TM) CERTIFIED SECURES DOMAIN PRIDE.ORG AND RECEIVES HONOUR AT THE INAUGURAL INTERPRIDE GLOBAL GALA
ONGOING COMMITMENT TO LGBT+ COMMUNITY OF INCLUSION, EQUALITY & TRANSPARENCY 365 DAYS OF THE YEAR LONDON, May 31, 2023 /PR...
|
 |
Dynadot Announces Company Rebrand
SAN MATEO, Calif., June 2, 2023 /PRNewswire/ -- Dynadot, an ICANN-accredited privately held domain registrar, unveiled a new...
|
 |
OpenFortune and Voodoo Partner Offering Daily Prizes of Up To $15,000
NEW YORK, June 7, 2023 /PRNewswire/ -- OpenFortune Media , one of the fastest-growing media companies that delivers creative...
|
 |
New Web Addresses Pave the Way for LGBTQ+ Businesses to Thrive and Connect
Embracing the Power of .LGBT: Empowering LGBTQ+ Businesses in the Digital Age BELLEVUE, Wash., June 5, 2023 /PRNewswire/ -- I...
|
|
Submit News |
View More News
|
|
|
|
|
|
|
|