PHP - HTML

PHP - HTML

am 23.10.2007 16:19:12 von Galatorg

Is there a way to have .php extensions show as .html extensions on the
internet. Some sort of rewrite?

Re: PHP - HTML

am 23.10.2007 16:29:42 von Shelly

"Lamer" wrote in message
news:1193149152.826242.45170@q3g2000prf.googlegroups.com...
> Is there a way to have .php extensions show as .html extensions on the
> internet. Some sort of rewrite?

Why?

Re: PHP - HTML

am 23.10.2007 16:47:54 von Jerry Stuckle

Lamer wrote:
> Is there a way to have .php extensions show as .html extensions on the
> internet. Some sort of rewrite?
>
>

You could, but setting up your server to parse .html files as PHP.
However, this will create a lot of overhead on the server unnecessarily
parsing non-html pages.

But if you want to know how to do it (and why not to), try
alt.apache.configuration (assuming you're using Apache, of course).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: PHP - HTML

am 23.10.2007 17:04:21 von Captain Paralytic

On 23 Oct, 15:19, Lamer wrote:
> Is there a way to have .php extensions show as .html extensions on the
> internet. Some sort of rewrite?

Yes,
this is what OpenSEF does with Joomla URLs

Re: PHP - HTML

am 23.10.2007 19:00:29 von Vladimir Ghetau

On Oct 23, 3:19 pm, Lamer 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

Re: PHP - HTML

am 24.10.2007 05:11:36 von pkaluski

In article <1193149152.826242.45170@q3g2000prf.googlegroups.com>,
Lamer wrote:

> Is there a way to have .php extensions show as .html extensions on the
> internet. Some sort of rewrite?

Probably easiest with Apache's MultiViews (assuming you use Apache, that
is ;)). See .

But note that there are good arguments to not have filename extensions
in URLs at all. See and
.

--
Sander Tekelenburg
The Web Repair Initiative: