Difference between revisions of "CentOS 7.x Redirect bitnami wordpress from /wordpress to /"
From Notes_Wiki
m |
m |
||
Line 17: | Line 17: | ||
##:: RewriteBase / | ##:: RewriteBase / | ||
##:: # RewriteBase /wordpress/ | ##:: # RewriteBase /wordpress/ | ||
##:</pre> | |||
## Change final rewrite rule to: | |||
##:<pre> | |||
##:: RewriteRule . /index.php [L] | |||
##:</pre> | ##:</pre> | ||
## Comment banner config | ## Comment banner config |
Revision as of 06:52, 4 January 2021
<yambe:breadcrumb self="Redirect bitnami wordpress from /wordpress to /">CentOS_7.x_wordpress|Wordpress</yambe:breadcrumb>
CentOS 7.x Redirect bitnami wordpress from /wordpress to /
If bitnami installer is used it creates wordpress site at http://<FQDN>/wordpress. Many people prefer to not have /wordpress sub-folder. To redirect bitnami wordpress such that it works directly at / instead of /wordpress use:
- Open /opt/wordpress-5.0.3-2/apps/wordpress/conf/httpd-prefix.conf and update to
- #Alias /wordpress/ "/opt/wordpress-5.0.3-2/apps/wordpress/htdocs/"
- #Alias /wordpress "/opt/wordpress-5.0.3-2/apps/wordpress/htdocs"
- Alias / "/opt/wordpress-5.0.3-2/apps/wordpress/htdocs/"
- Include "/opt/wordpress-5.0.3-2/apps/wordpress/conf/httpd-app.conf"
-
- It is very important to Alias / with the path ending with / as shown above without that access denied message would be received
- Edit /opt/wordpress-5.0.3-2/apps/wordpress/conf/httpd-app.conf and update as follows
- Change RewriteBase as
- RewriteBase /
- # RewriteBase /wordpress/
- Change final rewrite rule to:
- RewriteRule . /index.php [L]
- Comment banner config
- # Include "/opt/wordpress-5.0.3-2/apps/wordpress/conf/banner.conf"
- Change RewriteBase as
- Edit /opt/wordpress-5.0.3-2/apps/wordpress/htdocs/wp-config.php and update
- #define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/wordpress');
- #define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/wordpress');
- define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/');
- define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/');
- Restart apache for new settings to take effect:
- /opt/wordpress-5.0.3-2/ctlscript.sh restart apache
<yambe:breadcrumb self="Redirect bitnami wordpress from /wordpress to /">CentOS_7.x_wordpress|Wordpress</yambe:breadcrumb>