You are here: Re: PHP include and changing page names « HTML « IT news, forums, messages
Re: PHP include and changing page names

Posted by Ed Mullen on 11/12/07 04:50

Jonathan N. Little wrote:
> Ed Mullen wrote:
>> I'm considering using PHP to include the menus on my Web pages. I've
>> tested it and it works fine (even though I know next to nothing about
>> PHP). My understanding is that the page that will import content
>> using a PHP include must have a .PHP extension. Which means that all
>> my page names (which now end in .html) will change. Which means that
>> the search engine results will point to non-existent pages.
>
> The include file doesn't but the calling file may for it to parse PHP,
> server settings dependent.
>
> <!-- caller.php -->
> <?php include_once('fileWithPhpCode.txt');
> ...
>
> But it is advisable to make the include file fileWithPhpCode.php so if
> some hacker call your file directly they will only see the html output
> not the php source.
>
>>
>> Any thoughts on what I might do about this dilemma?
>>
>
> Very simple example...
> .htaccess file
>
> RewriteEngine On
>
> RewriteRule ^(.*)\.html$ $1.php
>

Excellent. Thank you all. I do have the ability to edit the .htaccess
file. I will go read more so as not to be quite as dangerous as I am now.

--
Ed Mullen
http://edmullen.net
http://mozilla.edmullen.net
http://abington.edmullen.net
Introducing LITE - the new way to spell LIGHT with 20% fewer letters!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация