Question

How to active sudo a2enmod rewrite for centos?

Following the tutorial “How To Set Up Mod_Rewrite” indicates I should run the command “sudo a2enmod rewrite”, but I mark: sudo: a2enmod: command not found

anyone know how to fix it?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Using .htaccess files and setting AllowOverride All is not recommended. It’s better to put the rewrite commands in your Directory section in httpd.conf. To enable the rewrite engine in this context, you need to set “RewriteEngine On” and “Options FollowSymLinks” must be enabled. (From: http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule) <br> <br>This is what did it for me

In httpd.conf, search for <code>AllowOveride None</code> and change to <code>AllowOveride All</code>, then restart apache. <br>

Hi there, it seems no way to enable it on CentOS, see this for more information:http://serverfault.com/questions/558600/centos-bash-a2enmod-command-not-found