Ik was mezelf aan het bijscholen over .htacces files (nogmaals) en toen kwam ik het volgende tegen:
"When (not) to use .htaccess files
In general, you should never use .htaccess files unless you don't have access to the main server configuration file. There is, for example, a prevailing misconception that user authentication should always be done in .htaccess files. This is simply not the case. You can put user authentication configurations in the main server configuration, and this is, in fact, the preferred way to do things.
...
However, in general, use of .htaccess files should be avoided when possible. Any configuration that you would consider putting in a .htaccess file, can just as effectively be made in a <Directory> section in your main server configuration file."
bron:http://www.cirt.cnr.it/manual/howto/htaccess.html
In het kort waarom: .htacces zorgt voor nogal wat performance verlies schijnbaar en daardoor zou je alleen htacces files moeten gebruiken wanneer je niet de totale server in handen hebt waardoor je alles de algemene config file kunt aanpassen. Gelukkig kan ik dit wel echter loop ik tegen een probleem aan.
Ik kan echter nergens een werkend voorbeeld vinden van hoe je met directory hetzelfde kan doen als met een .htacces file.
bv
de volgende regel in .htacces
wordt het in directory vorm dan zoiets? (gebaseerd op http://httpd.apache.org/docs/2.2/mod/core.html#options)
Of is het toch gewoon niet mogelijk? Aangezien op http://httpd.apache.org/docs/2.2/mod/core.html#options) eigenlijk geen zaken als RewriteRule staan...
"When (not) to use .htaccess files
In general, you should never use .htaccess files unless you don't have access to the main server configuration file. There is, for example, a prevailing misconception that user authentication should always be done in .htaccess files. This is simply not the case. You can put user authentication configurations in the main server configuration, and this is, in fact, the preferred way to do things.
...
However, in general, use of .htaccess files should be avoided when possible. Any configuration that you would consider putting in a .htaccess file, can just as effectively be made in a <Directory> section in your main server configuration file."
bron:http://www.cirt.cnr.it/manual/howto/htaccess.html
In het kort waarom: .htacces zorgt voor nogal wat performance verlies schijnbaar en daardoor zou je alleen htacces files moeten gebruiken wanneer je niet de totale server in handen hebt waardoor je alles de algemene config file kunt aanpassen. Gelukkig kan ik dit wel echter loop ik tegen een probleem aan.
Ik kan echter nergens een werkend voorbeeld vinden van hoe je met directory hetzelfde kan doen als met een .htacces file.
bv
de volgende regel in .htacces
code:
1
| RewriteRule ^index/(.*)/?$ index.php?page=$1 [L] |
wordt het in directory vorm dan zoiets? (gebaseerd op http://httpd.apache.org/docs/2.2/mod/core.html#options)
code:
1
2
3
4
| <Directory />
AllowOverride All
</Directory> |
Of is het toch gewoon niet mogelijk? Aangezien op http://httpd.apache.org/docs/2.2/mod/core.html#options) eigenlijk geen zaken als RewriteRule staan...
Modelbouw - Alles over modelbouw, van RC tot diorama