I have create a AWS LightSail WordPress instance. I tried all the possible config available to run WordPress in sub directory in the above mentioned Instance. Now I briefing it to simple. I want the above said instance to map to example.com/blog
How we should achieve this. Any config to be done in DNS also welcomed! I wholeheartedly thank you for helping me!
Bitnami Engineer here,
Please follow the next steps to move wordpress from /
to /blog
.
Your /opt/bitnami/apps/wordpress/conf/httpd-prefix.conf
should look like this
Alias /blog/ "/opt/bitnami/apps/wordpress/htdocs/" Alias /blog "/opt/bitnami/apps/wordpress/htdocs" Include "/opt/bitnami/apps/wordpress/conf/httpd-app.conf"
Edit the following in /opt/bitnami/apps/wordpress/conf/httpd-app.conf
From: #RewriteBase /wordpress/
To: RewriteBase /blog/
From: RewriteRule. /index.php [L]
RewriteRule. /index.php [L]
To: RewriteRule. /blog/index.php [L]
RewriteRule. /blog/index.php [L]
Edit the following in /opt/bitnami/apps/wordpress/htdocs/wp-config.php
From:
define('WP_SITEURL', 'http://'. $_SERVER['HTTP_HOST']. '/'); define('WP_HOME', 'http://'. $_SERVER['HTTP_HOST']. '/');
To:
define('WP_SITEURL', 'http://'. $_SERVER['HTTP_HOST']. '/blog'); define('WP_HOME', 'http://'. $_SERVER['HTTP_HOST']. '/blog');
Finally restart apache:
$ sudo /opt/bitnami/ctlscript.sh restart apache
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.