Copy link to clipboard
Copied
Hi,
How would I move a completed Bootstrap nav menu out of my HTML files so it's in its own document, so that changed can be made in one place instead of having to do it on every page? JQuery? What's the best way?
Thanks.
If PHP is available on your web hosting plan, use PHP Server-Side-Includes for your site wide navigation.
Alt-Web Design & Publishing: Server-Side Includes with PHP
Basically, 1 include file contains only the relevant HTML menu code & nothing more. It's not a complete document, it's a code fragment. Depending on your Bootstrap menu, you will copy & paste just the navbar code into a new file and name it navbar.html or navbar.ssi or whatever you like.
The parent pages in which the include stat
...Copy link to clipboard
Copied
The first thing I and most people will ask -
'Do you have PHP available on your server'?
Copy link to clipboard
Copied
If PHP is available on your web hosting plan, use PHP Server-Side-Includes for your site wide navigation.
Alt-Web Design & Publishing: Server-Side Includes with PHP
Basically, 1 include file contains only the relevant HTML menu code & nothing more. It's not a complete document, it's a code fragment. Depending on your Bootstrap menu, you will copy & paste just the navbar code into a new file and name it navbar.html or navbar.ssi or whatever you like.
The parent pages in which the include statement occurs will need to be renamed with a .php extension. Most shared web hosts do not parse PHP code in ordinary .html files. If unsure, check with your hosting provider.
Nancy
Copy link to clipboard
Copied
Thank you. Yes, my hosting company does offer .php.
For an existing site with all .html pages, including index.html, what's the best way to handle the search engines as far as them all changing to .php pages? Leave the .html pages but delete the content and have links to their .php versions? 301 Redirects?
Thanks again.
Copy link to clipboard
Copied
I would replace all .html files with .php.
301 Redirect old .html to new .php files.
Add a robots.txt file to your server & Disallow any folders or file types you don't want indexed.
Add a new sitemap.xml to your server with the new .php pages.
Log-in to your Google Webmaster Tools account and ask Google to re-index your site.
Nancy