Edit the /opt/bitnami/apache2/conf/extra/httpd-ssl.conf
file and add the directives there. You need to wrap your .htaccess
stuff in a <Directory>
directive and that will be in turn inside the <VirtualHost>
directive.
1<VirtualHost _default_:443>
2
3# General setup for the virtual host
4DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"
5ServerName www.blah.com:443
6ServerAdmin admin@blah.com
7ErrorLog "/opt/bitnami/apache2/logs/error_log"
8TransferLog "/opt/bitnami/apache2/logs/access_log"
9
10<Directory "/opt/bitnami/apps/wordpress/htdocs">
11 AllowOverride All
12 Options FollowSymLinks
13
14 # BEGIN WordPress
15 RewriteEngine On
16 RewriteBase /
17 RewriteRule ^index\.php$ - [L]
18 RewriteCond %{REQUEST_FILENAME} !-f
19 RewriteCond %{REQUEST_FILENAME} !-d
20 RewriteRule . /index.php [L]
21 # END WordPress
22</Directory>
23
24</VirtualHost>
Restart Apache afterwards
1sudo /opt/bitnami/ctlscript.sh restart apache
Bitnami has rewrite module mod_rewrite
enabled by default on all their stacks so you don’t really need the usual <IfModule>
check.
mod_rewrite
is enabled by making sure it’s loaded in Apache conf fileBitnami includes rewrite module for Apache in all their applications by default.
1cat /opt/bitnami/apache2/conf/httpd.conf | grep 'mod_rewrite'
LoadModule rewrite_module modules/mod_rewrite.so
If the line has a #
at the beginning then it means it is commented out and the module is not being loaded. Edit the file with nano
adn remove the # at the beginning of the line.
Make sure that the AllowOverride All
and Options FollowSymLinks
directives are there. They are required for pretty permalinks to work.
Make sure you have restarted Apache
1sudo /opt/bitnami/ctlscript.sh restart apache