SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast mgsninja's Avatar
    Join Date
    Dec 2001
    Location
    Norway
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Adding a new file extension

    I'm trying to use .htaccess to add a new file extension for php files just for some fun and I can get it to be phrased by the PHP engine, but not add the MIME type. I know I can do this in php, but that's not what I'm after.

    AddType application/x-httpd-php .hph
    AddMime text/html hph
    ...

  2. #2
    FreeBSD The Power to Serve silver trophy pippo's Avatar
    Join Date
    Jul 2001
    Location
    Italy
    Posts
    4,514
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    create an .htaccess under your document root and use:
    /.htaccess
    Code:
    <FilesMatch "\.hph$">
    SetHandler application/x-httpd-php
    </FilesMatch>
    so files, even in sub-directories, with .hph extension will be parsed by php parser.


    :-) pippo

    p.s.
    AddMime is not an Apache directive. ;-)
    Mr Andrea
    Former Hosting Team Advisor
    Former Advisor of '03

  3. #3
    SitePoint Enthusiast mgsninja's Avatar
    Join Date
    Dec 2001
    Location
    Norway
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks.
    It suxs beeing a noob
    ...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •