Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

214
Views
agregue .html a la URL pero no se encontraron los resultados 404

Lea esto y bababa, pero lamentablemente ninguno de ellos puede indicarme cómo depurar.

Estoy tratando de redirigir debajo de la URL https://example.com/hello a https://example.com/hello.html

Así es como lo hice

Primero

vim /etc/apache2/apache2.conf , establezca AllowOverride All en <Directory /var/www/>

Ahora es

 <Directory /> Options FollowSymLinks AllowOverride None Require all denied </Directory> <Directory /usr/share> AllowOverride None Require all granted </Directory> <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>

Segundo

sudo service apache2 restart

Tercero

Cree .htaccess en public_html y debajo del código

 <IfModule mod_rewrite.c> Options FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_URI} !^.*\.html$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ %{REQUEST_FILENAME}.html </IfModule>

Pero aún devuelve 404 no encontrado como a continuación.

ingrese la descripción de la imagen aquí

¿Alguna sugerencia o alguna pieza que me falte para configurar apache? Gracias


------RESPONDER------

Se perdió la configuración de mod_rewrite . puede checar esta publicacion

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Está agregando .html al final de %{REQUEST_FILENAME} , lo que siempre generará un 404, ya que %{REQUEST_FILENAME} representa la ruta completa del sistema de archivos, no la ruta URI.

Deberías usar esta regla:

 RewriteEngine On RewriteCond %{REQUEST_URI} !\.html$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . %{REQUEST_URI}.html [L]

o mejor:

 RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.html -f RewriteRule ^(.+?)/?$ $1.html [L]
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!