Aller au contenu

« Htaccess » : différence entre les versions

De Marmits Wiki
 
Aucun résumé des modifications
 
(4 versions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
[[category:linux]] [[category:apache]] [[category:web]]
== rediriger un sous-dossiers d'un domaine vers un sous domaine ==
exemple.com/test -> test.exemple.com
<syntaxhighlight lang="apache" line>
RewriteEngine on
RewriteCond %{REQUEST_URI} /(.+)/
RewriteRule .* http://%1.exemple.com
</syntaxhighlight>
 
== Protection répertoire ==
Créer un htpasswd dans un répertoire "protect"
<syntaxhighlight lang="apache" line>
htpasswd -c .htpasswd geo -> en mode basic
htdigest -c .htpasswdprivatphp "PRIVATPHP" geo -> en mode digest
</syntaxhighlight>
 
[[category:Linux]] [[category:Apache]] [[category:Dev]]

Dernière version du 23 février 2025 à 16:29

rediriger un sous-dossiers d'un domaine vers un sous domaine

exemple.com/test -> test.exemple.com

 RewriteEngine on
 RewriteCond %{REQUEST_URI} /(.+)/
 RewriteRule .* http://%1.exemple.com

Protection répertoire

Créer un htpasswd dans un répertoire "protect"

htpasswd -c .htpasswd geo -> en mode basic 
htdigest -c .htpasswdprivatphp "PRIVATPHP" geo -> en mode digest