Diferències
Ací es mostren les diferències entre la revisió seleccionada i la versió actual de la pàgina.
| Ambdós costats versió prèvia Revisió prèvia Següent revisió | Revisió prèvia | ||
| web:apache:htaccess:start [20/06/2020 03:51] – admin | web:apache:htaccess:start [20/06/2020 04:12] (actual) – [otros] admin | ||
|---|---|---|---|
| Línia 1: | Línia 1: | ||
| - | = .htaccess, tutorial y ejemplos | + | = .htaccess |
| - | {{tag> | + | |
| - | + | ||
| - | /vía [[http:// | + | |
| - | + | ||
| - | <callout type=" | + | |
| * [[web: | * [[web: | ||
| Línia 35: | Línia 30: | ||
| * prevenir el listado de carpetas:< | * prevenir el listado de carpetas:< | ||
| - | === bloquear referrer maliciosos (no hotlinking) | ||
| - | * <code apache> | ||
| - | RewriteCond %{HTTP_REFERER} ejemplo\.com [NC,OR] | ||
| - | RewriteCond %{HTTP_REFERER} otroejemplo\.com | ||
| - | RewriteRule .* - [F]</ | ||
| - | * Si el visitante no es de mi sitio -example.com- y pide un fichero de esas extensiones, | ||
| - | RewriteCond %{HTTP_REFERER} !^$ | ||
| - | RewriteCond %{HTTP_REFERER} !^http:// | ||
| - | RewriteRule .*\.(zip|mp3|avi|wmv|mpg|mpeg)$ http:// | ||
| - | * ojo con enlaces que si que quieres permitir - como un RSS - a alguno de tus ficheros | ||
| === negar petición | === negar petición | ||
| Línia 77: | Línia 62: | ||
| == otros | == otros | ||
| + | === cambiar el fichero que abre o busca por defecto | ||
| <code apache> | <code apache> | ||
| Directoryindex index.php index2.php | Directoryindex index.php index2.php | ||
| Línia 119: | Línia 105: | ||
| - | == cambiar el fichero que abre o busca por defecto | ||
| - | == redireccions | ||
| - | <code; .htaccess> | ||
| - | RewriteEngine on | ||
| - | rewriterule ^(.*)coneixelteucervell(.*)$ https:// | ||
| - | rewriterule ^(.*)$ https:// | ||
| - | </ | ||
| - | * redirecció en fitxer configuració virtualhost de :80 a :443 | ||
| - | < | ||
| - | < | ||
| - | ServerName landing.fidmag.org | ||
| - | Redirect permanent / https:// | ||
| - | </ | ||
| - | < | ||
| - | ServerName brainpredict.com | ||
| - | ServerAlias www.brainpredict.com | ||
| - | Redirect permanent / https:// | ||
| - | </ | ||
| - | |||
| - | < | ||
| - | ServerAdmin webmaster@localhost | ||
| - | ServerName landing.fidmag.org | ||
| - | ServerAlias braindredict.com | ||
| - | |||
| - | DocumentRoot / | ||
| - | < | ||
| - | #Options -Indexes | ||
| - | Options FollowSymLinks Indexes | ||
| - | AllowOverride All | ||
| - | Require all granted | ||
| - | </ | ||
| - | |||
| - | ErrorLog / | ||
| - | CustomLog / | ||
| - | |||
| - | SSLEngine on | ||
| - | SSLCertificateFile | ||
| - | |||
| - | < | ||
| - | SSLOptions +StdEnvVars | ||
| - | </ | ||
| - | < | ||
| - | SSLOptions +StdEnvVars | ||
| - | </ | ||
| - | </ | ||
| - | </ | ||