Hi @rubent
I´ve done the changes but still not working,
I have reviewed my proposed changes and they are incorrect, so this should explain it! Let's get down to the root here so you can choose what is more convenient.
Your instance right now is defining 6 VirtualHosts, 2 of them in apache2/conf/bitnami/bitnami.conf
(port 80 and 443) and another four custom ones in apps/wordpress/conf/httpd-vhosts.conf
.
The ones defined in bitnami.conf
are the default ones, that will handle any request incoming to that port and matching the server name defined in /opt/bitnami/apache2/conf/httpd.conf
...
ServerName siXXXXXXas.com:80
...
That is why accessing your site with no www.
prefix (that is, matching the ServerName defined in that file) results in the Bitnami page. When using the www.
, the servername does not match and hence your application uses the custom VirtualHost configured with ServerAlias www.sieXXXXXXXXdas.com
.
A) If you don't plan to use the default VirtualHost in bitnami.conf
, you could simply change the /opt/bitnami/apache2/conf/httpd.conf
so as not to match the domain:
...
- ServerName siXXXXXXas.com:80
+ ServerName localhost:80
...
B) You can also force the redirection from that default VirtualHost using my proposed changes before (notice the updated rules this time)
<VirtualHost _default_:80>
DocumentRoot "/opt/bitnami/apache2/htdocs"
+ RewriteEngine On
+ RewriteCond %{HTTP_HOST} !(^www) [NC]
+ RewriteRule ^/(.*) http://www.sieXXXXXXXXdas.com/$1 [R=permanent,L]
...
</VirtualHost>
<VirtualHost _default_:443>
DocumentRoot "/opt/bitnami/apache2/htdocs"
+ RewriteEngine On
+ RewriteCond %{HTTP_HOST} !(^www) [NC]
+ RewriteRule ^/(.*) https://www.sieXXXXXXXXdas.com/$1 [R=permanent,L]
SSLEngine on
...
</VirtualHost>
Basically, this means that every requests handled by these VirtualHosts that do not start with the www.
prefix will be redirected to www.sieXXXXXXXXdas.com/whatever-path
Remind to test your syntax before restarting apache 
Also I'm trying to set up a new wordpress instance on the server so created another vhost outside of apps/wordpress with a silly basic index.html however I got a permission denied: ForbiddenYou don't have permission to access this resource.
Would you mind opening a new ticket for this? We usually try to have single-themed threads so that users in the community can find answers to specific topics easier. We will be more than happy to provide you with assistance there as well
.
Could you please try either proposed changes?
Best regards,
Jose Antonio Carmona
Was my answer helpful? Click on 