Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

156
Vistas
I need on the apache2.conf a <Directory> that hides .php extensions

I'm using a virtual machine to emulate an apache server (linux debian), and I can't manage to hide the .php file extension on the website's URL.

I'm modifying the apache2.conf in /etc/apache2/apache.conf instead of adding a .htaccess file because Apache suggests to do so.

I currently have:

<Directory /var/www/html>
    AllowOverride All
    Require all granted
    RewriteEngine On
    Options FollowSymLinks
    RewriteCond %{REQUEST_FILENAME}.php !-f
    RewriteRule (.*) $1.php [L]
</Directory>
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I suggest you to use .htaccess in directories where you want to run php files without extension.


Depends on the version of your PHP engine, add the following lines:

PHP 7.0

<FilesMatch '^[^.]+$'>
  SetHandler application/x-httpd-php70
</FilesMatch>

PHP 7.0 Single

<FilesMatch '^[^.]+$'>
  SetHandler application/x-httpd-php70s
</FilesMatch>

PHP 7.0 FastCGI

<FilesMatch '^[^.]+$'>
  SetHandler fcgid70-script
</FilesMatch>

Don't forget to remove the .php extension from such files in those directories.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda