• Portada
    • Recientes
    • Usuarios
    • Registrarse
    • Conectarse

    .htaccess file management

    Programado Fijo Cerrado Movido Sistemas operativos
    3 Mensajes 3 Posters 628 Visitas
    Cargando más mensajes
    • Más antiguo a más nuevo
    • Más nuevo a más antiguo
    • Mayor número de Votos
    Responder
    • Responder como tema
    Accede para responder
    Este tema ha sido borrado. Solo los usuarios que tengan privilegios de administración de temas pueden verlo.
    • cobitoC Desconectado
      cobito Administrador
      Última edición por

      This thread is part of the guide to set up a server on Debian.
      Remember that the content of Hardlimit is under Creative Commons license.

      Procedure

      As root:

      a2enmod rewrite nano /etc/apache2/sites-available/000-default.conf 

      Add within the corresponding VirtualHost section a Directory section:

      <Directory "/var/www/html">    Require all granted    Options Indexes FollowSymLinks MultiViews    AllowOverride All </Directory> 
      /etc/init.d/apache2 restart 

      Explanation

      The.htaccess file is a vital configuration file that applies to each subfolder of our server. In it we can do things like block certain pages, limit the linking of certain material (like images) and many more.

      To enable it, the only thing we have to do is activate the rewrite module, so we write in the console as root:

      a2enmod rewrite 

      Now we must edit with Nano the 000-default.conf file as root:

      nano /etc/apache2/sites-available/000-default.conf 

      There we must create a Directory section within a VirtualHost section. This is done by copying the following text within a VirtualHost section:

      <Directory "/var/www/html">    Require all granted    Options Indexes FollowSymLinks MultiViews    AllowOverride All </Directory> 

      In the Directory field we must put the folder where we want.htaccess to work. If we want to enable.htaccess in some folders and disable it in others, we can use a scheme like the following:

      <Directory "/var/www/html">    AllowOverride None </Directory>  <Directory "/var/www/html/wordpress">    Require all granted    Options Indexes FollowSymLinks MultiViews    AllowOverride All </Directory> 

      A functional configuration would look like this:
      4749945f-a8a1-45de-aca0-eb26cd29ad9f-imagen.png

      In this way,.htaccess will work in /var/www/html/wordpress but not in /var/www/html.

      Each Directory section is independent and there can be as many as we need within a VirtualHost section.

      Finally we restart the Apache server with:

      /etc/init.d/apache2 restart 

      Toda la actualidad en la portada de Hardlimit
      Mis cacharros

      hlbm signature

      S 1 Respuesta Última respuesta Responder Citar 3
      • cobitoC cobito referenced this topic on
      • S Desconectado
        sinchan2 @cobito
        Última edición por

        @cobito excelente explicación.

        Un saludo

        pablogoreanP 1 Respuesta Última respuesta Responder Citar 1
        • pablogoreanP Desconectado
          pablogorean @sinchan2
          Última edición por cobito

          @sinchan2 many thanks for the explanation, it is greatly appreciated, recently I tried to edit it myself at [url edited by moderation] and I messed it up, I mean the website broke... because I wanted to make a 301.

          1 Respuesta Última respuesta Responder Citar 0
          • 1 / 1
          • First post
            Last post

          Foreros conectados [Conectados hoy]

          0 usuarios activos (0 miembros y 0 invitados).
          febesin, pAtO,

          Estadísticas de Hardlimit

          Los hardlimitianos han creado un total de 543.5k posts en 62.9k hilos.
          Somos un total de 34.9k miembros registrados.
          roymendez ha sido nuestro último fichaje.
          El récord de usuarios en linea fue de 123 y se produjo el Thu Jan 15 2026.