Forum Moderators: phranque

Message Too Old, No Replies

Getting .htaccess to work!

         

dimebar

1:35 pm on Sep 16, 2005 (gmt 0)

10+ Year Member



Hi, hope somebody can help...

I have just taken over the hosing for a client - and having set the site up realised there was a bit not working. There is a gallery section with pop up images. The pop ups are controlled by a .htaccess which redirects to a index.php file, which in turn contains all of the content for the pop ups.

The site was developed by another company, so my lack of knowledge of the site is hampered more by my lack of knowledge regarding php and Apache config settings....

When i click on the thumbnail to make the pop up appear I get an internal server error. I checked the error log and found this:

[Fri Sep 16 10:05:39 2005] [alert] [client 99.999.999.999] /home/httpd/vhtdocs/abcdefg.co.uk/gallery/.htaccess: Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a module not included in the server configuration

The .htaccess contains this:

RewriteEngine on
RewriteCond %{REQUEST_URI} .*
RewriteRule ^(.*) index.php [L]

From what I can gather after investigating the problem for a while is that I need configure the server to allow the .htaccess to run in the right folder by changing the httpd.conf.

I added
'<Directory "/home/httpd/vhtdocs/abcdefg.co.uk/gallery">
AllowOverride All
</Directory>'
to the httpd.conf and rebooted the server, this made no difference.

Now I can't find any other useful info anywhere (possibly because I don't really know what I'm looking for), so if anyone can shed light on this subject it would be great!

Romeo

2:35 pm on Sep 16, 2005 (gmt 0)

10+ Year Member



Hi Dimebar,

welcome here in WW.

It is probably this, from your error_log:
"... defined by a module not included in the server configuration ..."
Make sure, that the server has the rewrite module (mod_rewrite) included in the config.

Regards,
R.

dimebar

3:09 pm on Sep 16, 2005 (gmt 0)

10+ Year Member



Hi Romeo,

Thanks for that! I had a look at the config file, and it has 2 references to mod_rewrite. They are:

#LoadModule rewrite_module /usr/lib/apache/mod_rewrite.so
&
#AddModule mod_rewrite.c

Should there be anything else?

jdMorgan

3:52 pm on Sep 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



dimebar,

Welcome to WebmasterWorld!

Those two lines are commented-out, and so do nothing. Remove the "#" from the start of the lines to uncomment them. Restart your server for the change to take effect.

Jim

dimebar

4:08 pm on Sep 16, 2005 (gmt 0)

10+ Year Member



Woohoo!

Yep, that did it! Thank you for your help, you are very kind! And I learnt something new too.

Cheers,

Ryan