You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Rajasekaran Deepak <de...@students.iiit.net> on 2004/03/27 18:10:53 UTC

[users@httpd] Serving XHTML as HTML

I want my XHTML documents to be available as HTML also. Currently, I am
doing this by making a symbolic link to the '.xhtml' file, with '.xhtml'
replaced by '.html' in the name of the link. (This was suggested by
<http://www.w3.org/2003/01/xhtml-mimetype/content-negotiation>.)

Is is possible to make files with extension '.xhtml.html' available as both
XHTML and HTML? If it is not possible, could it be implemented as a new
feature?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Serving XHTML as HTML

Posted by Rajasekaran Deepak <de...@students.iiit.net>.
* Joshua Slive <jo...@slive.ca> 2004-03-27
> You could do this with mod_rewrite.
> 
> RewriteEngine On
> RewriteRule ^(.*)\.html$ $1.xhtml [T=text/html]
> 
> This should allow you to store the files with the xhtml extension, but
> also request them with the html extension and get the appropriate mime
> type.

Each of my files has a separate directory and is named
'index.en-us.xhtml.utf8.ssi'. The symbolic link is named
'index.en-us.html.utf8.ssi'. All markup content has URIs ending with '/'.

'.htaccess' contains:
    AddType application/xhtml+xml .xhtml
    MultiviewsMatch Any

To know if the document was served as XHTML or HTML, I use:
    <!--#if expr="$DOCUMENT_URI = /.xhtml/"-->

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Serving XHTML as HTML

Posted by Joshua Slive <jo...@slive.ca>.
On Sat, 27 Mar 2004, Rajasekaran Deepak wrote:

> I want my XHTML documents to be available as HTML also. Currently, I am
> doing this by making a symbolic link to the '.xhtml' file, with '.xhtml'
> replaced by '.html' in the name of the link. (This was suggested by
> <http://www.w3.org/2003/01/xhtml-mimetype/content-negotiation>.)
>
> Is is possible to make files with extension '.xhtml.html' available as both
> XHTML and HTML? If it is not possible, could it be implemented as a new
> feature?

You could do this with mod_rewrite.

RewriteEngine On
RewriteRule ^(.*)\.html$ $1.xhtml [T=text/html]

This should allow you to store the files with the xhtml extension, but
also request them with the html extension and get the appropriate mime
type.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Serving XHTML as HTML

Posted by Rajasekaran Deepak <de...@students.iiit.net>.
* Steffen Heil <li...@steffen-heil.de> 2004-03-27
> You see, that HTML is not XHTML and vise versa !?!
> You definitly should serve files with approiate mime type.
XHTML 1 is mostly a subset of HTML 4. Therefore, XHTML 1 files can be served
as both XHTML and HTML. XHTML 2, on the other hand, will not be a subset of
HTML. Therefore, it cannot be served as HTML.

> AND remember, that every link inside these files will point either to .html
> or .xhtml. Making them available in two ways will solve your problem only on
> the first hit.
Each of my files has a separate directory and is named
'index.en-us.xhtml.utf8.ssi'. The symbolic link is named
'index.en-us.html.utf8.ssi'. All markup content has URIs ending with '/'.

I suggest that files with extension '.xhtml.html' be made available as both
XHTML and HTML. This will be very useful for XHTML 1 content. This can be
generalized to '.html.txt' (device may not be HTML-capable), '.pnm.txt'
(ASCII-encoded image) ('pnm(5)' man page), etc.

This is already implemented for natural languages. For example,
'.de-de.en-us' means that it contains both German (as used in Germany) and
English (as used in the USA), with German used more often.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Serving XHTML as HTML

Posted by Steffen Heil <li...@steffen-heil.de>.
Hi

You see, that HTML is not XHTML and vise versa !?!
You definitly should serve files with approiate mime type.
AND remember, that every link inside these files will point either to .html
or .xhtml. Making them available in two ways will solve your problem only on
the first hit.

Regards,
  Steffen


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org