By Flobin
Hi. I’m using Kirby, which comes with a standard .htaccess file. I’ve enabled .htaccess through editing /etc/apache2/apache2.conf, but I think my .htaccess is not working. (I have enabled mod_rewrite with a2enmod rewrite.)
My folder structure is as follows:
|-/var
|-|-/www
|-|-|-/domain.com
|-|-|-|-.htaccess
|-|-|-|-index.php
|-|-|-|-/kirby
|-|-|-|-other (kirby) stuff
The relevant rewrite rules are:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^content/(.*)\.(txt|md|mdown)$ error [R=301,L]
RewriteRule ^site/(.*) error [R=301,L]
RewriteRule ^kirby/(.*) error [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^panel/(.*) panel/index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]
</IfModule>
I am getting a 403 error when visiting my site: cool-house.nl.
What should I change to make things work as intended? Should I place another .htaccess file in /var/www?
Many thanks in advance!
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!
If anyone else is having the same problem, I solved it by putting the configuration right into the apache config file, like so:
<Directory "/var/www/domain.com">
rules
</Directory>
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.