StatCounter User Forum  
StatCounter Free web tracker and counter

Go Back   StatCounter User Forum > Webmaster > Lounge (non-StatCounter related topics here!)

Reply
 
Thread Tools Display Modes
  #1  
Old 04-19-2008, 08:48 PM
flamencouk flamencouk is offline
Member
 
Join Date: Oct 2007
Location: London UK
Posts: 69
Default xhtml file extension

I am in the process of re-writing one of my sites in XHTML 1.1. I want to serve it properly as xhtml+xml to the agents that understand, and am therefore changing all my page extensions to .xhtml. I'm going to use a mod rewrite in the .htaccess to serve text/html to IE.

My question is: will the main search engines have any issues with the extension change ( assuming I keep the actual page names the same) as far as indexing/page rank etc. are concerned?

Also if any of you guys have experience of serving xhtml "properly" across browsers, is mod rewrite a sensible way to go for Apache? I've read about using php headers, but this somehow seems "cleaner"
__________________
...Passion through Dance!
UK Flamenco Shows | European Flamenco Agency
Reply With Quote
  #2  
Old 04-20-2008, 04:51 PM
lemons lemons is offline
Active Member
 
Join Date: Jan 2007
Location: at home
Posts: 322
Default

don't know if this helps but my site is all xhtml 1.0 transitional and all code is valid and displays as intended across browsers but all files are as .htm extensions apart from the index page which is .html extension
__________________
Reply With Quote
  #3  
Old 04-20-2008, 05:03 PM
webado's Avatar
webado webado is offline
Moderator
 
Join Date: Apr 2004
Location: Montreal, Quebec, Canada
Posts: 28,145
Default

It doesn't matter what the extension is, only what the content is served as.

IE cannot handle XHTML 1.1.

If you want to manage that in .htaccess keep in mind it has to be set conditionally based on the browser.

I'd rather do it by php script directly at the top of the page itself and generate the doctype and content type and whatnot that way, based on user agent.

Never mind that I am clueless on the specifics anyway
__________________
Christina
>>Forum Moderator<<

Please do not PM me for support. The forum is here for that.
Reply With Quote
  #4  
Old 04-20-2008, 05:45 PM
flamencouk flamencouk is offline
Member
 
Join Date: Oct 2007
Location: London UK
Posts: 69
Default

Quote:
Originally Posted by webado View Post
It doesn't matter what the extension is, only what the content is served as.
So Google could then see mysite/index.html as a different page from mysite/index.xhtml for indexing purposes if I served one as text/html and the other as application/xhtml+xml, even if the content was the same?

If that's the case then I'd better stick with 1.0 and save myself the potential problem of losing ranking. I could always validate as 1.1 and just serve as text/html (as most sites do), keeping the html extension.

Probably just trying to be too clever
__________________
...Passion through Dance!
UK Flamenco Shows | European Flamenco Agency
Reply With Quote
  #5  
Old 04-20-2008, 05:50 PM
webado's Avatar
webado webado is offline
Moderator
 
Join Date: Apr 2004
Location: Montreal, Quebec, Canada
Posts: 28,145
Default

The robot is not a browser. It's not like it will see it sometimes one way and other times another way.

In any case the code needs to be valid for the doctype used. Beyond that the robot parses to get the content. The markup doesn't count as content as long as it's valid and doesn't get scrambled up as content.
__________________
Christina
>>Forum Moderator<<

Please do not PM me for support. The forum is here for that.
Reply With Quote
  #6  
Old 04-22-2008, 10:12 AM
flamencouk flamencouk is offline
Member
 
Join Date: Oct 2007
Location: London UK
Posts: 69
Default

Thanks Chris.
It's only a static site so I don't really "need" to make use of xml advantages, but it's nice to know that if I did change my page names to .xhtml filenames, it wouldn't be an issue
__________________
...Passion through Dance!
UK Flamenco Shows | European Flamenco Agency
Reply With Quote
  #7  
Old 04-22-2008, 10:25 AM
webado's Avatar
webado webado is offline
Moderator
 
Join Date: Apr 2004
Location: Montreal, Quebec, Canada
Posts: 28,145
Default

Changing the file name (even if just the extension) will be ok as long as you also implement 301 redirections from old to new.
__________________
Christina
>>Forum Moderator<<

Please do not PM me for support. The forum is here for that.
Reply With Quote
  #8  
Old 04-22-2008, 05:56 PM
donecweb donecweb is offline
Senior Member
 
Join Date: Mar 2005
Location: Texas
Posts: 1,035
Default

Christina, are you saying that if you replace say a page named index.html with index.xhtml or index.php you should implement 301 redirections from old to new?
__________________
DonEc

Links and accurate information provide the best answer, while garbage in provides garbage out.
Reply With Quote
  #9  
Old 04-22-2008, 08:36 PM
jamesicus jamesicus is offline
Member
 
Join Date: Jul 2007
Posts: 241
Default

From time to time over the past several years I have served my Home page as XHTML 1.0 with Content-Type text/html to IE Browsers and with Content-Type application/xhtml+xml to Browsers that recognize that content type -- via Content Negotiation.

My current Home Page is served in this manner. I compose the great majority of my pages using HTML 4.01 Markup (a few using ISO-HTML) and they are naturally served as text/html.

I actually started using Content Negotiation for XHTML documents as an experiment to see how the concept worked in practice -- I continue to do so mainly just for fun -- I am growing old and need some diversions from serious work!

I also employ Content Negotiation for -- my XHTML+RDFa test page -- there is no "Appendix C" provision (ala XHTML 1.0) in the W3C RDFa in XHTML Syntax and Processing document -- if XHTML+RDFa documents are served as text/html the W3C Validator adds the following generic note to the successful validation report (quote):

"Warning Conflict between Mime Type and Document Type

The document is being served with the text/html Mime Type which is not a
registered media type for the XHTML + RDFa Document Type. The recommended media type for this document is: application/xhtml+xml"

I note that the W3C is currently serving some of their XHTML+RDFa documents as Content-Type text/html.

James
__________________
Web Authoring References & Resources
Validated (X)HTML (Strict) - CSS - RDF/XML
Portal to all of my Web Sites and Pages
Reply With Quote
  #10  
Old 04-22-2008, 10:09 PM
flamencouk flamencouk is offline
Member
 
Join Date: Oct 2007
Location: London UK
Posts: 69
Default

I don't really want to have to implement redirects - I'd rather just create valid XHTML 1.1 and serve it as text/html for the time being, converting to application/xhtml+xml at some point in the future.

It would be satisfying to serve application/xhtml+xml to the relevant browsers (everything except IE, it seems) via Content Negotiation. I have got this working with a .htaccess mod-rewrite and it all validates in WC3 with no MIME warning, but it obviously requires an xhtml file extension to achieve this.

Am I right in this thinking?
__________________
...Passion through Dance!
UK Flamenco Shows | European Flamenco Agency
Reply With Quote
Reply

Thread Tools
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 On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:34 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.