Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:web:web-hosting:web-management:htaccess-file [2015/12/04 16:29]
jojo ↷ Page déplacée et renommée de en:hebergement-mutualise:gestion-web:fichier-htaccess à en:web:web-hosting:web-management:htaccess-file
en:web:web-hosting:web-management:htaccess-file [2016/10/12 17:15] (current)
dedibox [Disable the listing of a directory]
Line 22: Line 22:
 This function allows you to replace (for example) the message of a 404 error (Not found) for a more friendly text or with a redirection to another URL (local or external). This function allows you to replace (for example) the message of a 404 error (Not found) for a more friendly text or with a redirection to another URL (local or external).
  
-You have to use the command ErrorDocument to do this. Following some examples of the usage: ​+You have to use the command ​<​nowiki>​ErrorDocument</​nowiki> ​to do this. Following some examples of the usage: ​
  
   ErrorDocument 404 /​myfile404.html   ErrorDocument 404 /​myfile404.html
Line 32: Line 32:
  
 (typically the root of your website but not necessarily) (typically the root of your website but not necessarily)
- 
  
 ===== Disable the listing of a directory ===== ===== Disable the listing of a directory =====
Line 45: Line 44:
   Options -Indexes   Options -Indexes
  
-<note warning>​**ATTENTION : IndexOptions -Indexes ​ is obsolete and does not work anymore on the shared ​hosting platform, you have to configure it using the directive Options -Indexes**</​note> ​+<note warning>​**ATTENTION : <​nowiki>​IndexOptions</​nowiki> ​-Indexes ​ is obsolete and does not work anymore on the web hosting platform, you have to configure it using the directive Options -Indexes**</​note> ​
  
   * **Step 2: Upload the file**   * **Step 2: Upload the file**
Line 52: Line 51:
  
 The only thing you have to do now, is to test it. The only thing you have to do now, is to test it.
- 
  
  
Line 102: Line 100:
 To limit the access to the users specified in the file "​passlist.txt",​ you need to create a htaccess file in the directory you want to protect. The content of the file should be as following: To limit the access to the users specified in the file "​passlist.txt",​ you need to create a htaccess file in the directory you want to protect. The content of the file should be as following:
  
-  AuthUserFile /flex/​domain/​DOMAIN.TLD/​site/​www/​passlist.txt+  AuthUserFile /PATH/​passlist.txt
   AuthName "Acces Restricted"​   AuthName "Acces Restricted"​
   AuthType Basic   AuthType Basic
   require valid-user   require valid-user
 +  ​
 +The "​PATH"​ will have to be replaced by:
 +  * For the WEB hosting: ''/​flex/​domain/​DOMAIN.TLD/​site/​www/''​
 +  * For the CLOUD hosting: ''/​var/​www/​DOMAIN.TLD/​www''​
  
-<​note>​You need to replace "​DOMAIN.TLD"​ with your domain name.</​note>​+<​note ​important>You need to replace "​DOMAIN.TLD"​ with your domain name.</​note>​
  
-The command AuthUserFile specifies the path to the users table. The path is relative to "/"​ of your hosting, therefore your path will generally start with at least "​www/"​ or "​blog/"​.+The command ​<​nowiki>​AuthUserFile</​nowiki> ​specifies the path to the users table. The path is relative to "/"​ of your hosting, therefore your path will generally start with at least "​www/"​ or "​blog/"​.
  
-If you have saved your users table in the directory /​www/​secret/​password/​ with the name '​mylist.txt',​ you need to change accordingly the directive AuthUserFile: ​+If you have saved your users table in the directory /​www/​secret/​password/​ with the name '​mylist.txt',​ you need to change accordingly the directive ​<​nowiki>​AuthUserFile</​nowiki>​
  
   AuthUserFile ​ /​flex/​domain/​DOMAIN.TLD/​site/​www/​secret/​password/​mylist.txt   AuthUserFile ​ /​flex/​domain/​DOMAIN.TLD/​site/​www/​secret/​password/​mylist.txt
Line 130: Line 132:
  
 For those who want to learn more about this, we recommend [[http://​www.apache.org/​docs/​|the user guide of Apache]] which treats in detail all aspects of authentification. For those who want to learn more about this, we recommend [[http://​www.apache.org/​docs/​|the user guide of Apache]] which treats in detail all aspects of authentification.
- 
- 
 ==== Remarks ==== ==== Remarks ====
  
Line 204: Line 204:
 The Apache module **mod_rewrite** is activated on the web hosting servers of Online.net and it works by default with htaccess files. The Apache module **mod_rewrite** is activated on the web hosting servers of Online.net and it works by default with htaccess files.
  
-The directive **FollowSymlinks** is activated and must not be modified. Doing so will result in a HTTP 500 error.+The directive **<​nowiki>​FollowSymlinks</​nowiki>​** is activated and must not be modified. Doing so will result in a HTTP 500 error.
  
 Let us do an example, the domain name is domain.ext, the url we are going to call is http://​www.domain.ext/​index.php with the name of the page as argument Let us do an example, the domain name is domain.ext, the url we are going to call is http://​www.domain.ext/​index.php with the name of the page as argument
Line 220: Line 220:
 \\ \\
 Now you can open the file http://​www.domaine.ext/​test.html in your web browser, index.php will be executed with the argument "​test"​. Now you can open the file http://​www.domaine.ext/​test.html in your web browser, index.php will be executed with the argument "​test"​.
 +