Forum Moderators: bakedjake
[domain.com...]
to this:
[domain.com...]
But still use server side includes within my pages. I'm know that I can write rules to specify this in .htaccess but I couldn't find this specific example documented anywhere.
Here's an example that will allow SSI to be used in files with .html. Can I modify this to include files without an extention?
AddType text/html .html
AddHandler server-parsed .html Thank you.
You can try something like this:
Options -Indexes
AddType text/html .josh
AddHandler server-parsed .josh
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*)$ /$1.josh [L]
Now any page you upload to your server with filetype ".josh" will be available via http when requested with or without the ".josh" file type, and will be parsed for SSIs.
You actually don't need to define a new file type, except to distiguish between files that will receive this special handling and those that won't. If you plan to have SSI on all pages, you can omit the steps of defining a new file type and adding a handler for it, and simply rewrite all files without an extension to ".shtml"
The above practice has pitfalls, such as the fact that directory indexes cannot be made available, and the added complexity of rewriting all requests for pages with SSI.
HTH,
Jim
<added> The reason all this is needed is that you can't add server parsing to a blank filetype. </added>
The reason all this is needed is that you can't add server parsing to a blank filetype.
Text files without an extension can be parsed. XBitHack will parse all text files with the execute bit set.
Just use the following in .htaccess
XBitHack on
[httpd.apache.org...]