Enabling Mod_Rewrite

On Ubuntu Server...

Page 1 of 1

3 Replies - 3070 Views - Last Post: 11 November 2010 - 09:42 PM

#1 Ntwiles  Icon User is offline

  • D.I.C Addict

Reputation: 148
  • View blog
  • Posts: 830
  • Joined: 26-May 10

Enabling Mod_Rewrite

Posted 10 November 2010 - 06:51 PM

Hey guys, I'm trying to enable mod_rewrite and I'm getting some shit. I put the following in httpd.conf:

AddModule mod_rewrite.c
LoadModule mod_rewrite /usr/lib/apache2/modules/mod_rewrite.so


I also used the terminal to enable mod_rewrite with the command: a2enmod rewrite

It prompted me to restart apache so I did. Then I get the error:

apache2: Syntax error on line 207 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/httpd.conf: Can't locate API module structure `mod_rewrite' in file /usr/lib/apache2/modules/mod_rewrite.so: /usr/lib/apache2/modules/mod_rewrite.so: undefined symbol: mod_rewrite


Meanwhile, back at the ranch: I try to load any page on my site and get a 500 internal service error. Can anyone tell me what's going on?

Is This A Good Question/Topic? 0
  • +

Replies To: Enabling Mod_Rewrite

#2 girasquid  Icon User is offline

  • Barbarbar
  • member icon

Reputation: 108
  • View blog
  • Posts: 1,825
  • Joined: 03-October 06

Re: Enabling Mod_Rewrite

Posted 11 November 2010 - 03:31 PM

It sounds like you don't actually have mod_rewrite installed on your system. What happens when you remove those lines from your httpd.conf?
Was This Post Helpful? 0
  • +
  • -

#3 moopet  Icon User is offline

  • binary decision maker
  • member icon

Reputation: 339
  • View blog
  • Posts: 1,185
  • Joined: 02-April 09

Re: Enabling Mod_Rewrite

Posted 11 November 2010 - 04:23 PM

If you don't do the things you did to your conf file, on ubuntu with apache2 installed from the repos, you should just be able to do
a2enmod rewrite



What this actually does is (pretty much)
sudo ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load



So check your mods-enabled folder to make sure that rewrite.load is there, and has stuff in it.
Was This Post Helpful? 0
  • +
  • -

#4 Ntwiles  Icon User is offline

  • D.I.C Addict

Reputation: 148
  • View blog
  • Posts: 830
  • Joined: 26-May 10

Re: Enabling Mod_Rewrite

Posted 11 November 2010 - 09:42 PM

I either solved the problem or it decided to work it out itself. I found that:

LoadModule mod_rewrite /usr/lib/apache2/modules/mod_rewrite.so

Was actually already contained in the rewrite.load file, so I took it out of httpd.conf, and everything seems to work beautifully. Thanks for the help guys.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1