Difference between revisions of "CentOS 7.x Redirect bitnami wordpress from /wordpress to /"

From Notes_Wiki
(Created page with "<yambe:breadcrumb self="Redirect bitnami wordpress from /wordpress to /">CentOS_7.x_wordpress|Wordpress</yambe:breadcrumb> =CentOS 7.x Redirect bitnami wordpress from /wordpre...")
 
m
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<yambe:breadcrumb self="Redirect bitnami wordpress from /wordpress to /">CentOS_7.x_wordpress|Wordpress</yambe:breadcrumb>
[[Main Page|Home]] > [[CentOS]] > [[CentOS 7.x]] > [[CentOS 7.x Web Based Tools|Web Based Tools]] > [[CentOS 7.x wordpress|Wordpress]] > [[CentOS 7.x Redirect bitnami wordpress from /wordpress to /]]
=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:
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:
Line 11: Line 10:
#::  Include "/opt/wordpress-5.0.3-2/apps/wordpress/conf/httpd-app.conf"
#::  Include "/opt/wordpress-5.0.3-2/apps/wordpress/conf/httpd-app.conf"
#:</pre>
#:</pre>
#:: '''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
# Edit /opt/wordpress-5.0.3-2/apps/wordpress/conf/httpd-app.conf and update as follows
## Change RewriteBase as
## Change RewriteBase as
Line 16: Line 16:
##::      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
Line 35: Line 39:




<yambe:breadcrumb self="Redirect bitnami wordpress from /wordpress to /">CentOS_7.x_wordpress|Wordpress</yambe:breadcrumb>
[[Main Page|Home]] > [[CentOS]] > [[CentOS 7.x]] > [[CentOS 7.x Web Based Tools|Web Based Tools]] > [[CentOS 7.x wordpress|Wordpress]] > [[CentOS 7.x Redirect bitnami wordpress from /wordpress to /]]

Latest revision as of 09:16, 25 August 2022

Home > CentOS > CentOS 7.x > Web Based Tools > Wordpress > 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:

  1. 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
  2. Edit /opt/wordpress-5.0.3-2/apps/wordpress/conf/httpd-app.conf and update as follows
    1. Change RewriteBase as
      RewriteBase /
      # RewriteBase /wordpress/
    2. Change final rewrite rule to:
      RewriteRule . /index.php [L]
    3. Comment banner config
      # Include "/opt/wordpress-5.0.3-2/apps/wordpress/conf/banner.conf"
  3. 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'] . '/');
  4. Restart apache for new settings to take effect:
    /opt/wordpress-5.0.3-2/ctlscript.sh restart apache


Home > CentOS > CentOS 7.x > Web Based Tools > Wordpress > CentOS 7.x Redirect bitnami wordpress from /wordpress to /