admin管理员组文章数量:1022560
I recently migrated my wordpress multisite from localhost to aws bitnami multisite. I used duplicator pro, deleted everything inside the wordpress/htdocs
folder and ran the installer.php
hrom there. Good news: installation was successful (Despite me thinking this way was stupid). Bad News : All the paths are messed up. The 2 main problems here are thus
1) All the css and js file links in the head tag are showing the path as mainsite/subsite/folderpath/filename.js
instead of mainsite/folderpath/filename.js
like in my localhost.
2) When I try going into wp-admin of any of the subsite using mainsite/subsite/wp-admin.php
, it enters an infinite loop of redirects.
Now I gathered from different answers on stack that the issue is with the htaccess file/files in the conf folder. Frankly I can't understand what is in there so I simply tried copying the contents of my .htaccess file(standard multisite htaccess) into the different .conf files one by one to no effect. I am also not sure if position at which i pasted is the correct one.
I also added the following to wp-config as some answers suggested but didn't help:
define('WP_SITEURL','myip.xip.io');
define('WP_HOME','myip.xip.io');
Any ideas what i can do to fix this? Here are the htaccess.conf file after I added the multisite code:
# This file was updated by Duplicator Pro on 2019-04-21 09:03:51.
# See htaccess.orig for the .htaccess original file.
# BEGIN WordPress (3.5+ Multisite Subdirectory)
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
# END WordPress
<Directory "/opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/akismet">
# Only allow direct access to specific Web-available files.
# Apache 2.2
<IfModule !mod_authz_core.c>
Order Deny,Allow
Deny from all
</IfModule>
# Apache 2.4
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
# Akismet CSS and JS
<FilesMatch "^(form\.js|akismet\.js|akismet\.css)$">
<IfModule !mod_authz_core.c>
Allow from all
</IfModule>
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</FilesMatch>
# Akismet images
<FilesMatch "^logo-full-2x\.png$">
<IfModule !mod_authz_core.c>
Allow from all
</IfModule>
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</FilesMatch>
</Directory>
Here is the httpd-prefix.conf which I haven't edited.
DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"
#Alias /wordpress/ "/opt/bitnami/apps/wordpress/htdocs/"
#Alias /wordpress "/opt/bitnami/apps/wordpress/htdocs"
RewriteEngine On
RewriteCond "%{HTTP_HOST}" ^ec2-([0-9]{1,3})-([0-9]{1,3})-([0-9]{1,3})-([0-9]{1,3})\..*\.amazonaws(:[0-9]*)?$
RewriteRule "^/?(.*)" "%{REQUEST_SCHEME}://%1.%2.%3.%4%5/$1" [L,R=302,NE]
#Init xip redirection
RewriteEngine On
RewriteCond "%{HTTP_HOST}" ^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})(:[0-9]*)?$
RewriteRule "^/?(.*)" "%{REQUEST_SCHEME}://%1.%2.%3.%4.xip.io%5/$1" [L,R=302,NE]
#End xip redirection
Include "/opt/bitnami/apps/wordpress/conf/httpd-app.conf"
I recently migrated my wordpress multisite from localhost to aws bitnami multisite. I used duplicator pro, deleted everything inside the wordpress/htdocs
folder and ran the installer.php
hrom there. Good news: installation was successful (Despite me thinking this way was stupid). Bad News : All the paths are messed up. The 2 main problems here are thus
1) All the css and js file links in the head tag are showing the path as mainsite/subsite/folderpath/filename.js
instead of mainsite/folderpath/filename.js
like in my localhost.
2) When I try going into wp-admin of any of the subsite using mainsite/subsite/wp-admin.php
, it enters an infinite loop of redirects.
Now I gathered from different answers on stack that the issue is with the htaccess file/files in the conf folder. Frankly I can't understand what is in there so I simply tried copying the contents of my .htaccess file(standard multisite htaccess) into the different .conf files one by one to no effect. I am also not sure if position at which i pasted is the correct one.
I also added the following to wp-config as some answers suggested but didn't help:
define('WP_SITEURL','myip.xip.io');
define('WP_HOME','myip.xip.io');
Any ideas what i can do to fix this? Here are the htaccess.conf file after I added the multisite code:
# This file was updated by Duplicator Pro on 2019-04-21 09:03:51.
# See htaccess.orig for the .htaccess original file.
# BEGIN WordPress (3.5+ Multisite Subdirectory)
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
# END WordPress
<Directory "/opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/akismet">
# Only allow direct access to specific Web-available files.
# Apache 2.2
<IfModule !mod_authz_core.c>
Order Deny,Allow
Deny from all
</IfModule>
# Apache 2.4
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
# Akismet CSS and JS
<FilesMatch "^(form\.js|akismet\.js|akismet\.css)$">
<IfModule !mod_authz_core.c>
Allow from all
</IfModule>
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</FilesMatch>
# Akismet images
<FilesMatch "^logo-full-2x\.png$">
<IfModule !mod_authz_core.c>
Allow from all
</IfModule>
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</FilesMatch>
</Directory>
Here is the httpd-prefix.conf which I haven't edited.
DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"
#Alias /wordpress/ "/opt/bitnami/apps/wordpress/htdocs/"
#Alias /wordpress "/opt/bitnami/apps/wordpress/htdocs"
RewriteEngine On
RewriteCond "%{HTTP_HOST}" ^ec2-([0-9]{1,3})-([0-9]{1,3})-([0-9]{1,3})-([0-9]{1,3})\..*\.amazonaws(:[0-9]*)?$
RewriteRule "^/?(.*)" "%{REQUEST_SCHEME}://%1.%2.%3.%4%5/$1" [L,R=302,NE]
#Init xip redirection
RewriteEngine On
RewriteCond "%{HTTP_HOST}" ^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})(:[0-9]*)?$
RewriteRule "^/?(.*)" "%{REQUEST_SCHEME}://%1.%2.%3.%4.xip.io%5/$1" [L,R=302,NE]
#End xip redirection
Include "/opt/bitnami/apps/wordpress/conf/httpd-app.conf"
本文标签: multisiteWrong filepaths and admin page infinite reload after migrating to aws bitnami
版权声明:本文标题:multisite - Wrong filepaths and admin page infinite reload after migrating to aws bitnami 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745535504a2154941.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论