Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: .htaccess file  (Read 5495 times)

0 Members and 1 Guest are viewing this topic.

Blackberry

    Topic Starter


    Adviser
  • For those with wings, fly to your dreams.
    .htaccess file
    « on: February 21, 2007, 10:37:50 AM »
    Hi there,

    I have a server, a local server (localhost) and an online server who have both apache 2.0. Now I try to execute the underlined command in a .htaccess file, but the server gives an error. Perhaps
    mod_rewrite isn't activated, but I don't know how to do this (please note, that I can not access
    the setting file from php nor apache on the online server, because it is shared hosting. Perhaps you
    can change settings in a .htaccess file, don't know). Perhaps it is an other problem...
    My code is:

    RewriteEngine on
    RewriteRule ^cms/([a-z]*)/(.*).html module.php?code=$1-$2
    RewriteRule ^admin/([a-z]*)/(.*).html admin.php?code=$1-$2


    And I get on both servers the following error:

    [Mon Feb 19 16:51:51 2007] [alert] [client 127.0.0.1] *path to error*: Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a module not included in the server configuration

    It seems like the mod isn't installed or activated, buth I rather think it is the last one. Any help how to (perhaps install it?) or activate it? or just a solution to this problem.

    Thanks

    Blackberry

    P.S. bonus question, on my local host I can't run php info, how can you set this on (there I CAN access the config file..)
    « Last Edit: February 21, 2007, 10:38:43 AM by blackberry »
    Everybody knows you can't click here. But I know you will try it :)

    Rob Pomeroy



      Prodigy

    • Systems Architect
    • Thanked: 124
      • Me
    • Experience: Expert
    • OS: Other
    Re: .htaccess file
    « Reply #1 on: February 21, 2007, 02:28:39 PM »
    Quote
    Perhaps mod_rewrite isn't activated
    Correct - that's what it looks like.  The ISP may have disabled it for security reasons.

    Quote
    Perhaps you can change settings in a .htaccess file, don't know
    Not that one.  The httpd.conf would need altering and Apache reloading.

    Quote
    bonus question, on my local host I can't run php info, how can you set this on (there I CAN access the config file..)
    In your php.ini:

    expose_php = On
    Only able to visit the forums sporadically, sorry.

    Geek & Dummy - honest news, reviews and howtos

    Blackberry

      Topic Starter


      Adviser
    • For those with wings, fly to your dreams.
      Re: .htaccess file
      « Reply #2 on: February 22, 2007, 01:38:21 AM »
      and how can you set rewriteenginte on in the settings file? What line should I edit
      « Last Edit: February 22, 2007, 01:38:58 AM by blackberry »
      Everybody knows you can't click here. But I know you will try it :)

      Rob Pomeroy



        Prodigy

      • Systems Architect
      • Thanked: 124
        • Me
      • Experience: Expert
      • OS: Other
      Re: .htaccess file
      « Reply #3 on: February 22, 2007, 05:06:20 AM »
      In httpd.conf, you want something like:

      LoadModule rewrite_module modules/mod_rewrite.so

      See also http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
      Only able to visit the forums sporadically, sorry.

      Geek & Dummy - honest news, reviews and howtos

      Blackberry

        Topic Starter


        Adviser
      • For those with wings, fly to your dreams.
        Re: .htaccess file
        « Reply #4 on: February 23, 2007, 05:39:15 AM »
        That worked, thanks, Rob!
        Everybody knows you can't click here. But I know you will try it :)

        Rob Pomeroy



          Prodigy

        • Systems Architect
        • Thanked: 124
          • Me
        • Experience: Expert
        • OS: Other
        Re: .htaccess file
        « Reply #5 on: February 23, 2007, 12:56:32 PM »
        No problem.
        Only able to visit the forums sporadically, sorry.

        Geek & Dummy - honest news, reviews and howtos