Jump to content

Ho to enable mod_rewrite


ryy705

Recommended Posts

Hello,

I am a mod_rewrite noob who got stuck on the first step.  How do I enable mod_rewrite?  I added the line "RewriteEngine On" in the apache2.conf file but when I restart apache I get following message: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

 

What am I doing wrong?  Many thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/115222-ho-to-enable-mod_rewrite/
Share on other sites

Thank you for your response.

I am using kubuntu. I and I just installed mod_rewrite, placed the 'RewriteEngine On' line in apache2.conf file and restarted apache with without a problem.  But .htaccess doesn't seem to be working. I placed the line 'InvalidDirective Here' in the .htaccess file.  But I can still load the pages in that folder.  Is this because I am running everything on local computer?  I have this line in the apache2.conf file: 'AccessFileName .htaccess'.  Does this mean that .htaccess is enabled?

I followed the instructions. Then I created a .htaccess file with the following lines in it:

 

AuthUserFile /usr/local/you/safedir/.htpasswd

AuthGroupFile /dev/null

AuthName EnterPassword

AuthType Basic

 

require user wsabstract

 

 

But I can go to that directory without being asked for a password.  Do you need to see a copy of any of the configuration files?

PS.  I did not create a password file.  But I don't think that matters.  Thank you.

  • 3 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.