Ubuntu enables Apache support for.htaccess

  • 2020-05-13 04:09:04
  • OfStack

Steps:

Terminal operation


sudo a2enmod

The program prompts the name of the module to be activated. Enter:

The rewrite

Modify /etc/apache2/ sites-enabled / 000-default (this link points to the site configuration file)
Change the AllowOverride property to All (the default www directory, or directory where you need to apply.htaccess) and save.

Reload apache


sudo /etc/init.d/apache2 restart

ModRewrite opening method with xampp:

It's easy to turn on Mod Rewrite:

Find httpd.conf in your XAMPP installation directory (located at \etc\ httpd.conf)
Open it with vim or another text editor
Find "AllowOverride None" and replace it with "AllowOverride All". (just modify the first one.)
Again, find "#LoadModule rewrite_module modules/ mod_rewrite.so" and remove the "#" from the front

Restart XAMPP

Then Mod Rewrite is enabled :)

That's all for this article, and I hope it will be helpful for you to start your support for.htaccess.

Please take a moment to share this article with your friends or leave a comment. We will sincerely appreciate your support!


Related articles: