Keywords: LAMP/MAMP/WAMP - AWS - How to - Other
I am new to Lamp and Wordpress. I had a very specific requirement of hosting a static website at the root and wordpress blog as subdiretory.
I found the solution in this excellent post - https://community.bitnami.com/t/amazon-lightsail-static-website-on-domains-root-wordpress-on-sub-directory/57990
I followed the suggestion of @jsalmeron and created a LAMP stack on Lightsail and installed wordpress. I can now place my static html files in /opt/bitnami/apache2/htdocs and it is served at my root domain of the website (example.com)
My wordpress blogs are now hosted at example.com/wordpress.
Now I want to change from example.com/wordpress --> example.com/blogs
I followed the instrutions, again by @jsalmeron, in the same post:
This way you would have WordPress in IP/wordpress, which could be changed to /blog by editing the Apache configuration file /opt/bitnami/apps/wordpress/conf/httpd-prefix.conf (change /wordpress to /blog). Then, you also need to edit /opt/bitnami/apps/wordpress/htdocs/wp-config.conf and modify the WP_URL section.
My httpd-prefix.conf file reads as :
Alias /blogs/ "/opt/bitnami/apps/wordpress/htdocs/"
Alias /blogs "/opt/bitnami/apps/wordpress/htdocs"
My wp-config.php file reads as:
define('WP_SITEURL', 'http://' . $SERVER['HTTPHOST'] . '/wordpress');
define('WP_HOME', 'http://' . $SERVER['HTTPHOST'] . '/blogs');
I have tried all combinations of changin the above to lines but it didn't work .
When I go to example.com/blogs ; I get a 404 error page. This 404 page is also not of Wordpress theme but that of the browser.
I am not able to sort out this issue and other blogs/issues on the internet have not helped. Being new to wordpress, I need help!