1.

Solve : .htaccess file?

Answer»

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..) 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 = Onand how can you set rewriteenginte on in the settings file? What line should I editIn 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.htmlThat worked, thanks, Rob!No problem.


Discussion

No Comment Found