Method of including external file (PHP or SSI)

I was making the homepage by using the frame before. The reason is that the maintenance of the menu is easy. However, it groped for other methods of not using the frame feeling for the fault of the frame to stand out.

After the external file was taken by using PHP or SSI and it knew the menu was made, and there was a method of making the page that inserted the affiliate program, this method decided to be adopted.

Of course, if it is not a server that can use PHP or SSI, this method cannot be done.

Advantage that uses PHP or SSI for menu and affiliate

After coming to use PHP or SSI for the menu and the affiliate, it became very easy to manage the file. It is because it becomes easy to maintain the menu and the affiliate script inserted in each page. Especially, the script of the AdSense of Google was each paging especially effective because it was the same and good basically.

Moreover, the error did not go out at all, and the script's being rewritten without permission disappeared though it became an error by the homepage creation software (homepage builder etc.), and the homepage builder rewrote the script in the affiliate script without permission. Especially, worry that rewrites the AdSense code by mistake that the include file is excluded when the batch of all files is changed with the software of TEXTSS disappears.

Especially, the Google AdSense is prohibited rewriting the script, and can use the homepage builder at ease.

It is a thing that the maintenance of the site map becomes quite unnecessary as other effects. My site map is composed only of the enumeration of the menu that finds and is outside file. The menu file should not change the site map at the addition of the page by the translation changed by all means.

Include the external file using PHP and the menu has been made

What is PHP does execute the script described in the HTML document by PHP of the server and as a result It is the one passed to Web a browser as HTML data.

To call the menu in the PHP file (The extension is usual php), as follows is done.

<?php include('http://domain/***/inc/menu.inc'); ?>

Because it is not possible to use it when the domain is changed and the domain is different when it is this method, as follows is done to use it by the general purpose.

<?php include($_SERVER['DOCUMENT_ROOT'].'/***/inc/menu.inc'); ?>

Here, '/***/inc/menu.inc'   starts from  /by the one that "http://domain" was removed from "http://domain/***/inc/menu.inc". )

Anything doesn't change even if the external file can be called from any directory in a similar way, and the domain is different and this method can be used. Moreover, the extension of the menu file is not inc and cares about neither any htm, html nor php. However, if it is a file that include is done, inc might be better.

It becomes an error, and, then, the program seems to be likely to stop if similar operation can be done even if include is not used and require is used, and there is no demanded file for require.

.Method of operating html file with PHP by using htaccess

It is not desirable to change the file name when thinking from the viewpoint of SEO measures. It is necessary to use the file name like the past without changing the file name. However, you will change the extension to php if a lot of pages are made by using PHP in full scale, and use a permanent move of the page (301 forwarding). The problem is not in SEO if it does so either.

To use the extension of the file that operates PHP with not only php but also htm and html. The following line is added to the htaccess file.

AddType application/x-httpd-php .htm .html

There may not be the dot before the extension this time by you even if it is.

The external file is taken by using SSI and the menu has been made.

SSI is abbreviation of Server Side Include. Because include is done by the servers end in a word, responsibility is borne in the server. Therefore, there seem to be a lot of servers that have not permitted the use of SSI.

To call the menu in SSI file (The extension is shtm or usual shtml), as follows is done.

Passing from the route of the domain to the menu is assumed to be "/***/ inc/menu.inc" as an example.

<!--#include virtual='/***/inc/menu.inc' -->

Here, '/***/inc/menu.inc' starts from '/" by the one that "http://domain" was removed from "http://domain/***/inc/menu.inc'. )

Anything doesn't change even if the external file can be called from any directory in a similar way, and the domain is different and this method can be used. Moreover, the extension of the menu file is not inc and cares about neither htm, shtm nor shtml. However, if it is a file that include is done, inc might be better.

Method of operating html file by SSI using .htaccess

To use the extension of the file that operates SSI with not only shtm and shtml but also htm and html. The following two lines are added to the htaccess file.

Options +Includes 
AddHandler server-parsed .htm .html

There may not be the dot before the extension this time by you even if it is. PHP and SSI at the same time cannot be made effective the html file moreover. Oh dear, though the done necessity and the meaning do not exist either.

The extension To htm and html all when SSI is made effective The html file is recognized that SSI by the server, and I am not desirable because it multiplies the load by the server.

Advantage of SSI other than the above

I am using "EfStat" of "Yugen-koubou" for the access analysis. High performance very though this is free software. The fault of the garble is remodeled and used though is regrettable stopping of the fault and the update garbled in UTF-8. Because the user bulletin board disappeared as for the content of remodeling, I have not understood any longer.

The search robot that visits at high speed can be caught by moving fcount.cgi by SSI on a part of page though it usually moves with CGI. What kind of search robot has come at the frequency of which extent is understood. Only the search robot can be caught by applying SSI and the access analysis to the concealment page, and it is very convenient.

The access analysis script put on each page is taken into each page by PHP or SSI and it uses it.