Täglich Shaarli

Alle Links eines Tag auf einer Seite.

July 30, 2024

Redirect HTML extension to PHP - PlotHost
thumbnail

It’s very easy to redirect requests to .html pages to .php pages. You will need to add some lines to the .htaccess file. If this file doesn’t exist in your directory then you must create it.

The two lines are:

RewriteEngine On
RewriteRule ^(.*).html$ /$1.php [L,R]

Now, HTML files will be redirected to php files. E.g. https://domain.com/test.html will be redirected to https://domain.com/test.php