Forum Moderators: phranque

Message Too Old, No Replies

Default index page problem

         

Asia_Expat

8:12 pm on Aug 14, 2007 (gmt 0)

10+ Year Member



I have made my site completely XHTML compliant including MIME type... except for one problem...

My server will not recognise index.xhtml as the default page for each directory (as it would with index.html).
Is there a magic command I can add to .htaccess to force my server to recognise the .xhtml extension as a default index page?

g1smd

8:37 pm on Aug 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I know this doesn't really help but I have have never seen a need to go beyond HTML 4.01 Strict coding.

Moving to XHTML gives no apparent advantages, and causes way too much grief, such as the stuff you afre dealing with.

Asia_Expat

8:55 pm on Aug 14, 2007 (gmt 0)

10+ Year Member



Yes, I've read what you are saying many times... and every time I ask for help, I get told that it's not worth the effort. However, I feel that as I am taking the XML route, it makes sense/future proof, to make my filenames .xhtml... I also recognise the merit of being compliant. Furthermore, challenging myself is part of my learning experience.

[edited by: Asia_Expat at 8:58 pm (utc) on Aug. 14, 2007]

jdMorgan

9:39 pm on Aug 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just add your default directory index page to your current DirectoryIndex list, or create a new one:

DirectoryIndex index.html index.php index.xhtml

The server will take the first file in the list that actually exists and use it as the directory index file.

Jim

Asia_Expat

11:58 pm on Aug 14, 2007 (gmt 0)

10+ Year Member



It works! Problem solved :-)

This template/cms I'm building is going to be a winner :)
[webmasterworld.com...]

g1smd

9:04 pm on Aug 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



OK. If you are heading towards XML then maybe that is the right long-term course to take.

At the moment I see it as far to much work and hurt for no benefit. :-)

jdMorgan

2:13 am on Aug 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As long as it's an informed decision, XML is fine...

I use it myself -- as XML+XHTML for WAP 2.0 mobile sites. It that context, it lets you do things that are not supported in HTML, like have the browser recognize a "phone number link," and dial that number when the link is clicked. That's what it's all about, it's an eXtensible Markup Language.

Jim