Hi,
I’m having issues getting mod_rewrite to load my .conf. Can anyone please help me figure out how to debug this further to see where the issue is please?
rewrite is enabled on apache2. The Include related to loading .conf (/etc/apache2/conf.d/userdata/ssl/2_4/domain/domain.com/.conf) is uncommented. There is a file at that location. I did a rebuild + restart. Still nothing.
I’ve also added LogLevel alert rewrite:trace8 to the userdata conf and have a tail -f running on /var/log/error_log, reload the page in question and nothing appears in tail.
Any ideas what I might do next please?
Thank you
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!
Hi @appl3s,
I’m glad you were able to resolve the issue! Nevertheless, I’m posting this for anyone else that might find this question and need more information on the topic.
In order for Apache to understand rewrite rules, we first need to activate mod_rewrite. It’s already installed, but it’s disabled on a default Apache installation. Use the a2enmod command to enable the module:
sudo a2enmod rewrite
This will activate the module or alert you that the module is already enabled. To put these changes into effect, restart Apache.
sudo systemctl restart apache2
mod_rewrite should now be fully enabled and you should be able to edit your .htaccess file with your rewrite rules.
Having said that, DigitalOcean have a very good tutorial on that topic which can be checked here:
Regards, KFSys
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.