How to enable mod_rewrite on apache set-up installations


I’ve installed an apache server site, with PHP 5.6 and MySQL 5.6. Uploading a phpinfo file with <?php phpinfo(); ?> I can’t find the mod_rewrite loaded. How can I activate it?

1 Like

I just tried the following on a new Apache install:

created an .htaccess file inside the WordPress web-root:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^(.*)$ [R=301,L]`

Saved and opened my Local site and it redirected to Google. Rewrite is available out-of-the-box.

The problem was with my script. Thanks.

1 Like

If you set up the site by default with nginx and change then to apache, the rewrite via .htaccess did not work for me.
But creating a new site with apache directly does work.

Maybe a bug in local?

1 Like