Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 875015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:11:51+00:00 2026-05-15T11:11:51+00:00

Background information: I’ve searched stackoverflow for a specific solution and couldn’t find one that

  • 0

Background information:

I’ve searched stackoverflow for a specific solution and couldn’t find one that fixed my situation. Thanks in advance for any help you can offer. Your knowledge is appreciated.

I’ve decided to accept a contract to “convert” (in the client’s words) a Joomla site into a WordPress site. Everything is going along smoothly, except that the Joomla site links to .html files, both in its navigation and in the content of 100+ posts.

Instead of going through each post one-by-one and updating the links or running a SQL command to remove “.html” from URLs, I’ve decided to put the pressure on .htaccess, with which I am somewhat comfortable.


What I’m trying to do ↓

In WordPress, I have custom permalinks enabled, and it is as follows:
/%category%/%postname%

Here’s an example of what one of the old URLs in the posts looks like:

http://the-site.com/category/the-webpage.html

I need the htaccess file to tell the webserver to remove the .html so the user, after visiting “http://the-site.com/the-webpage.html” is instead sent to:

http://the-site.com/category/the-webpage

I’m setting up the page stubs to follow the file name of the Joomla pages, so http://the-site.com/category/the-webpage will work.


My question:

Can you help me discover the solution to removing .html from the URL when someone visits the site, even if the HTML file doesn’t exist on the server?


Here’s how the .htaccess file looked before I made changes:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Here’s the latest .htaccess file as of 5:35pm Eastern:

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} \.html$
RewriteRule ^(.*)\.html$ $1 [R=301,L]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

The ↑latest .htaccess changes work. Thanks Tim!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:11:51+00:00Added an answer on May 15, 2026 at 11:11 am

    This will work to force an external redirection to your new URLs, but this may not be ideal for your situation. I’m still trying to think if there’s a way to keep the redirection internal and update the variable that WordPress uses to determine which page to serve up, but so far I haven’t thought of anything that would work.

    Entire .htaccess:

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} \.html$
    RewriteRule ^(.*)\.html$ $1 [R=301,L]
    
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background information: I presently have a hardware device that connects to the USB port.
Background information Let's say I have two database servers, both SQL Server 2008. One
Background Information: I'm part of a team of developers that runs a web application
Here is a little background information. I'm working on replacing a dll that has
For a little background information, I've got an application that's running in a loop,
For a little background information, I am trying to sync two calendars (one of
The Problem: Background Information I'm writing an application for a client that is to
Background information first: We are using a strongly-typed DataSet to manage transaction files. That
Background Information I have a distributed processing application that does data analysis. It is
Background Information: Ultimately, I would like to write an emulator of a real machine

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.