Static Html pages including each other, negative side effects?
So I have a website that has greate Search Engine rankings, and like 500+ html pages.
I want to unify the header and footer into one file, but don't want to change the .html file extension to a .php file extension for fear of an SEO hit.
So I tried:
<!--#include FILE="header.html" -->
And it worked on my server, is there a downside 开发者_C百科to this?
Like future updates to the godaddy server rendering my header/footer invisible ?
That is a server-side include. Meaning it happens server-side. Which means it has absolutely no effect on SEO.
The reason .html extension works is because the server was set up for that.
If your server is Apache, you can use mod_rewrite to convert a request for foo.html
into foo.php
. But setting up rewrite rules can be tricky, and it sounds like you already found a solution that works, so you should probably just use that.
So long as the HTML being returned hasn't changed, the search engine will not know anything has changed.
You could always get your server to parse HTML files through the PHP processor, for example, im Apache...
AddType application/x-httpd-php .html
..and then use <?php include 'header.html'; ?>
.
This will mean all HTML files will be passed through PHP though, which will incur a small performance fee.
You should consider moving those includes outside of your web root, so they are never accidentally stumbled across an indexed by a search engine.
Changing the file extension could hit your SEO, But using the same header information page title meta data will also hurt your SEO, as its duplicate content.
I would change the page extensions, but put in a 301 redirect on all the old pages. This way you wont lose any SEO goodness.
精彩评论