Changing .html in URL

Joined
Jul 10, 2022
Messages
2
Reaction score
0
Hello all,
the URL of my website is currently displayed with an .html extension at the end. I would like to remove this and have tried this code for the .htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)\.html$ https://www.wf-media.net$1/ [R=301,L]
</IfModule>

Even though the rewrite rule and 301 redirect was applied to the "new" domain here, it does not work appropriately. Although the .html extension is now removed, another problem has now occurred.

The trailing slash behind the top-level-domain (.com/ ) is no longer present. This means that subpages of my site are no longer displayed, because the URL is incorrect.

Can anyone help me with this problem?

Thanks in advance!
 
Joined
Mar 11, 2022
Messages
227
Reaction score
32
My -htaccess always looks that way
Code:
RewriteEngine On
RewriteBase / 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
AddDefaultCharset UTF-8

That' also means, you need a index.php to work with. Otherwise use your index.html in the rewrite rule
 
Joined
Mar 11, 2022
Messages
227
Reaction score
32
How does your htaccess look like now? Is there still any index.* file on your server? Which one? php, html....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top