Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:web:web-hosting:web-management:htaccess-file [2015/12/09 15:09]
jojo [Personalized error messages]
en:web:web-hosting:web-management:htaccess-file [2016/10/12 17:15] (current)
dedibox [Disable the listing of a directory]
Line 44: 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 51: 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 101: 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 129: 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 203: 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 219: 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"​.
 +