[thelist] Need .htaccess/mod_rewrite help

liorean liorean at f2o.org
Sun Dec 7 08:22:36 CST 2003


Greetings!

I've got a small problem that I hope someone here can help me with. I've 
been trying to set up a system so that you can specify return format in 
the path of the filename, something like this:

   http://example.net/type/file => http://example.net/file, Content-Type 
depending on the type (xml, html, xhtml, css, png, jpeg, pdf etc.)

This isn't too hard, but I want it to be a bit more intelligent:
- It should work the same in deep structures such as
   http://example.net/archives/type/file => http://example.net/archives/file
- If a directory with a name equal to the type in the path exists, it 
should search that directory for the file first, before it searches for 
just the file:
   http://example.net/css/file => http://example.net/css/file if exists, 
http://example.net/file if not. The file type should still be determined 
by the type specified in the path, though.
- xhtml should be send through a php script (residing in the root 
directory) that makes appropriate changes in the content as for whether 
the content is sent as text/html (and HTML 4.01 strict in that case) or 
application/xhtml+xml (and XHTML 1.1 in that case).

Anyone able to help me with this?
-- 
liorean <mailto:liorean at user.bip.net>

ViewStyles, ViewScripts, ToggleStyles and GraphicsInfo bookmarklets and 
Theme Switcher, Cookies Handler scripts:
<http://liorean.web-graphics.com/>



More information about the thelist mailing list