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

244
Views
How to redirect *.htm *,htm *,html to *.html in .htaccess

I need to redirect *.htm *,htm *,html to *.html, but when page is *.html leave same URL *.html.

I have this rule, but there's problem -> redirect loop. What should I change?

RewriteEngine On
RewriteRule ^(.*)(\.|,)htm(l?)$ $1.html [R=301]
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

As CBroe rightly commented that issue is with your pattern that also matches .html hence will cause a redirect loop.

You can fix it by using:

RewriteRule ^(.+)(?:\.htm|,html?)$ $1.html [R=301,L,NC,NE]

PS: This assumes RewriteBase directive has been used before.

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!