Forward compatibility html to x html with mod rewrite?

This is a discussion on Forward compatibility html to x html with mod rewrite? within the Apache Web Server forums, part of the Web Server and Related Forums category; With the Apache URL Rewriting Guide is is relative easy to make a website backward compatible. See http://httpd.apache....


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-19-2006
arjenmeijer@nietbereikbaar.nl
 
Posts: n/a
Default Forward compatibility html to x html with mod rewrite?

With the Apache URL Rewriting Guide is is relative easy to make a website backward compatible. See http://httpd.apache.org/docs/2.0/misc/rewriteguide.html .

But is it also possible to make it "forward compatible"? That is serve all html-pages as xhtml if the browser accepts xhtml. So all pages remain *.html for IE and present links, but are altered on the fly to xhtml with the correct mime type application/xhtml+xml. Of course, all pages are correct xhtml files.

The question is how? My try is below, but doesn't not work.

AddType application/xhtml+xml .xhtml

<Directory "/var/www/alforto.nl">
Options +FollowSymLinks
RewriteEngine on
# Our conditions are that the browser must accept XHTML
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml
# If it accepts xml than rewrite html to xhtml
RewriteRule *.html$ *.xhtml [L]
</Directory>


Arjen
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:58 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0