SetHandler directive won't work on server with php installed as cgi module

Discussion in 'PHP' started by paulocon, Feb 15, 2009.

  1. #1
    Hi all,

    Any help here would be greatly appreciated.

    I recently developed a website and user the setHandler directive in .htaccess to implement search-engine friendly URL's.

    e.g.

    www.mydomain.com/category/football

    instead of

    www.mydomain.com/category.php?catId=3

    I have a php page called category (no extension) that parses the URL to find the category (in this case football).

    My .htaccess looks like

    <Files "category">
    setHandler application/x-httpd-php
    </Files>

    <Files "guarantee">
    setHandler application/x-httpd-php
    </Files>

    <Files "contact_us">
    setHandler application/x-httpd-php
    </Files>

    <Files "contact">
    setHandler application/x-httpd-php
    </Files>

    This worked a treat on the server on which I deveoped the site but when I moved it to my client's hosting servers, it didn't.

    Atfer a lot of correspondence (don't you just love help desks!), I finally got the following answer:

    Thank you for contacting our technical support team.
    Commands you are using are used on the servers where php is installed as Apache module to specify mime type that should be used to identify files. Please note that php on your server is installed as cgi module and such directives do not work. Please use correct directives for php installed as cgi. Should you have any further questions or problems, please feel free to contact us any time, we are available 24/7.


    Anyone know what the correct directive are or how I can implement this. Any help would be really appreciated on this one.
     
    paulocon, Feb 15, 2009 IP
  2. DanielHB

    DanielHB Active Member

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #2
    Why don't you give the files back their extensions and use mod_rewrite instead?
     
    DanielHB, Feb 19, 2009 IP
  3. gapz101

    gapz101 Well-Known Member

    Messages:
    524
    Likes Received:
    8
    Best Answers:
    2
    Trophy Points:
    150
    #3
    SetHandler? maybe
     
    gapz101, Feb 19, 2009 IP
  4. Singhals

    Singhals Banned

    Messages:
    81
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    ask your host they may help...
     
    Singhals, Feb 20, 2009 IP