Background Information:
I was looking for stackoverflow for a specific solution and could not find the one that fixed my situation. Thanks in advance for any help you can offer. Your knowledge is appreciated.
I decided to accept the contract for the "conversion" (in the words of the client) of the Joomla website to the WordPress website. Everything goes smoothly, except that the Joomla site refers to .html files, both in its navigation and in the content of more than 100 posts.
Instead of going through each message in turn and updating links or running the SQL command to remove ".html" from the URLs, I decided to put pressure on .htaccess, which I'm somewhat comfortable with.
What am I trying to do & darr;
In WordPress, I have custom permalinks, and it looks like this: /% Category% /% postname%
Here is an example of what one of the old URLs looks like in posts:
http:
I need a htaccess file to tell the web server to remove the .html so that the user after visiting http://the-site.com/the-webpage.html "is sent instead:
http:
I set up page stubs to keep track of the file name on Joomla pages, so http://the-site.com/category/the-webpage will work.
My question is:
Can you help me find a solution to remove .html from the url when someone visits the site, even if the HTML file does not exist on the server?
This is what the .htaccess file looked like before I made the 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 last .htaccess file from 5:35 p.m. according to the eastern explanation:
# 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]
The last .htaccess changes the work. Thanks Tim!
joomla apache wordpress .htaccess
chris m
source share