You are here: Re: PHP - HTML « PHP Programming Language « IT news, forums, messages
Re: PHP - HTML

Posted by Vladimir Ghetau on 10/23/07 17:00

On Oct 23, 3:19 pm, Lamer <Galat...@gmail.com> wrote:
> Is there a way to have .php extensions show as .html extensions on the
> internet. Some sort of rewrite?

Yes, it can be done two ways:

option one) without renaming the PHP files to .HTML

add this to your htacccess (called url rewriting):

# -----------------------
RewriteEngine on
RewriteRule ^(.*).html$ $1.php

# ------------------------

Note this is a basic example, just to put you on track, if you want to
play with mod_Rewrite apache feature, I suggest, you should search
deeper.

Option two) by renaming the PHP files to HTML (playing with mime
types)

#-----------------------
AddType application/x-httpd-php .php .html
#-----------------------
add this to your .htaccess apache specific file

Now, these examples are for apache, hope they help, if you're using
other HTTP server, go study their documentation, I remember lighttpd
has a mod_rewrite feature also.


Cheers,

Vladimir Ghetau
http://www.Vladimirated.com

 

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

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