[Solved] How to decrease code redundancy while creating a new page in HTML [closed]


Use php for different repeating section of your pages, like create separate php pages for nav, footer, or contact and use it multiple times or where you need by using php include statement like

<?php include('nav.php');?> //to include nav section

And for your second question, YES, there is a way to that, With .htaccess under apache you can do the redirect like this:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.html$ /$1 [L,R=301] 

As for removing of .html from the url, you can use

http://www.example.com/page

for

http://www.example.com/page.html

solved How to decrease code redundancy while creating a new page in HTML [closed]