I have a bitnami
apache2 wordpress site.
my htdocs
is in the /opt/bitnami/apps/wordpress/htdocs
directory and everything inside that has been moved to a directory called blogs
which is in the same htdocs
as below:
/opt/bitnami/apps/wordpress/htdocs/
/blogs
- contents
And now when I access blog.mydomain.com
it gives the File permission
error as below:
Forbidden You don't have permission to access this resource.
But when I access blog.mydomain.com/blogs
I can see the content.
So, how I can redirect from blog.mydomain.com
to blog.mydomain.com/blogs
when someone hits blog.mydomain.com
Bitnami developer here!
If you don't plan to use the main domain as a double website setup, you could simply perform a redirection using the RedirectMatch
directive in your VirtualHost.
If you use the original VirtualHost setup of the instance, add the following lines to /opt/bitnami/apache2/conf/bitnami/bitnami.conf
:
...
<VirtualHost _default_:80>
+ RedirectMatch ^/$ /blog/
DocumentRoot "/opt/bitnami/apache2/htdocs"
<Directory "/opt/bitnami/apache2/htdocs">
...
</VirtualHost>
...
<VirtualHost _default_:443>
+ RedirectMatch ^/$ /blog/
DocumentRoot "/opt/bitnami/apache2/htdocs"
SSLEngine on
...
</VirtualHost>
...
Explanation: When the current URL matches the root of your domain, http(s)://YOUR-DOMAIN/
, the server will redirect to the second argument of the directive, http(s)://YOUR-DOMAIN/blog
If are using another VirtualHost setup, just place this modification there.