Skip to content

Instantly share code, notes, and snippets.

@dario2994
Last active April 6, 2024 18:18
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save dario2994/9445587 to your computer and use it in GitHub Desktop.
Save dario2994/9445587 to your computer and use it in GitHub Desktop.
Enable mod_rewrite in apache
  • Apache configuration file

    • ubuntu -> /etc/apache2/apache2.conf
    • arch -> /etc/httpd/conf/httpd.conf
  • Add mod_rewrite and .htaccess support for your site At the end of the configuration files add these lines:

    #My site mod_rewrite configuration
    <Directory "/ABSOLUTE/PATH/YourSite">
      AllowOverride All
    </Directory>
    
  • Enable mod_rewrite

    • ubuntu: sudo a2enmod rewrite
    • arch: Uncomment, in apache configuration file, the line LoadModule rewrite_module modules/mod_rewrite.so
  • Restart apache

    • ubuntu: sudo service apache2 restart
    • arch: sudo systemctl restart httpd
@nitroxplunge
Copy link

Hi,

Thanks for the guide. I'm using arch and followed everything, but when I got to the part where I uncomment the line LoadModule rewrite_module modules/mod_rewrite.so, I found it was never commented in the first place. I still get Internal Server errors even though mod_rewrite is enabled. Do you know why this is?

@sudoLife
Copy link

Hey, just wanted to say thanks, your solution really did the trick!
Btw I use Arch.

@filipbekic01
Copy link

AllowOverride All did the trick, thank you.

@0x9one
Copy link

0x9one commented Oct 20, 2020

Thank you so much
it's work for me and I use Arch

@syn-arch
Copy link

Thanks you sir,

@Lschulzes
Copy link

Hey man, you saved me, took a little bit of time to get here, but your guide was pretty neat, arch here...

@edcoelho
Copy link

edcoelho commented Jul 31, 2022

Your solution also works for Manjaro as it is an Arch-based distro. Thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment