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 14:11]
jojo [Secure a directory with an authentication]
en:web:web-hosting:web-management:htaccess-file [2016/10/12 15:15] (current)
dedibox [Disable the listing of a directory]
Line 44: Line 44:
   Options -Indexes   Options -Indexes
  
-<note warning>**ATTENTION : <nowiki>IndexOptions</nowiki> -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 100: 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:
  
-  <nowiki>AuthUserFile</nowiki> /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 <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/". 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/".
Line 200: 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 216: 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".
 +