Форумы / Cotonti / Core Labs / Ideas / Enhanced .htaccess

Proposed default .htaccess file for Cotonti

GHengeveld
#27297 30.11.2010 19:31
# Kort : This depends on the user choice and is done to stay away from duplicate links (same page with or without www). In most cases now www is removed to make the url shorter.
Agreed, it's a personal preference. I also think without it looks better, but there's a reason for using www. If the site itself is under the www subdomain, all cookies will be stored for this subdomain only. For performance it's better to serve images and other static content from a (sub)domain that does not have any cookies assigned to it. Otherwise the cookies will be sent along with every request for an image, even though that data is completely useless. If your site isn't under a subdomain all cookies stored by it are stored for every subdomain in the site, including a subdomain for static content, or Cotonti installations under other subdomains. It limits your options and if you have multiple sites under the same domain it can also be a security risk. Big sites often use different domain names entirely to serve static content, mainly to avoid the parallel download limit (2 files) of web browsers.

Many users probably wont use this technique and have only one instance of Cotonti running, so they can just as well remove the www instead of add it. That's up to the end user. Actually I should write a guide on how to setup static content delivery over a subdomain.

More info:
Use Cookie-free Domains for Components
Split Components Across Domains

Added 2 days later:

After discussing this with Trustmaster I've made some changes to the file. Some features have been removed or are disabled by default.

http://www.cotonti.com/datas/users/htaccess2_68.txt

  • Forcing PHP 5 is now optional (only needed for PHP 4 servers)
  • Disabling ETags is optional (only for cluster/cloud based servers)
  • Adding or removing 'www' is now up to the admin to decide, both are present but disabled by default.
  • Removing of ending slash has been removed, it's not really needed and may interfere with further rewriting.
Отредактировано: Koradhil (03.12.2010 07:41, 14 лет назад)