Advertisement
Sergio_Istea

redirect

May 20th, 2024
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <VirtualHost *:80>
  2. ServerName laboratorio.miercoles
  3. ServerAlias www.laboratorio.miercoles
  4. ServerAlias *.laboratorio.miercoles
  5. DocumentRoot /var/www/laboratorio.miercoles
  6.  
  7. # Habilitar motor de reescritura
  8. RewriteEngine On
  9.  
  10. # Redirigir cualquier subdominio que no sea www a la página de error
  11. RewriteCond %{HTTP_HOST} !^www\.laboratorio\.miercoles$ [NC]
  12. RewriteCond %{HTTP_HOST} ^([a-z0-9]+)\.laboratorio\.miercoles$ [NC]
  13. RewriteRule ^ /error.html [L,R=404]
  14.  
  15. # Directorio para la página de error personalizada
  16. Alias /error.html /var/www/error/error.html
  17.  
  18. <Directory "/var/www/error">
  19. AllowOverride None
  20. Require all granted
  21. </Directory>
  22. </VirtualHost>
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement