Can't access localhost from Internet using multisite subfolders
-
Hi All,
Goal:
- I wish to develop on my localhost using multisite subfolders.
- I need my team members to be able to access my sites from the internet.
I do assume this is actually possible. Virtual hosts maybe that map to correct folder? I’m still learning the ropes…
Problem:
I can access both front and back ends of primary and secondary sites from my internal machine. For example:
Primary site:??????127.0.0.1/wordpress
Secondary sites:?127.0.0.1/wordpress/s2
?????????????????????????127.0.0.1/wordpress/s3
?????????????????????????...etc
But whenever I try to access from external machines on internet using
110.22.25.35/wordpress
110.22.25.35/wordpress/s2
…etc
wordpress redirects to127.0.0.1/wordpress
on the external machine
Of course, since the external machine has nothing running there it fails to load. Note that secondary sites, eg110.22.25.35/wordpress/s2
are also redirected to127.0.0.1/wordpress
, not127.0.0.1/wordpress/s2
LocalMachine Directory Structure (partial):
C:\xampp
C:\xampp\apache
C:\xampp\mysql
C:\xampp\apps\wordpressMySQL DB from phpMyAdmin (partial):
bitnami_wordpress/wp-options/siteurl =https://127.0.0.1/wordpress
bitnami_wordpress/wp-options/home??=https://127.0.0.1/wordpress
Configuration (partial):
C:\xampp\apps\wordpress\htdocs\wp-config/** MySQL hostname */ define('DB_HOST', 'localhost:3306'); ... /* Multisite */ define( 'WP_ALLOW_MULTISITE', true ); define('MULTISITE', true); define('SUBDOMAIN_INSTALL', false); define('DOMAIN_CURRENT_SITE', '127.0.0.1'); define('PATH_CURRENT_SITE', '/wordpress/'); define('SITE_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 1); ... define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST'] . '/wordpress'); define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST'] . '/wordpress'); ...
C:\xampp\apps\wordpress\htdocs\.htaccess
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wordpress/ 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] </IfModule> # END WordPress
C:\xampp\apps\wordpress\conf\httpd-prefix.conf
Alias /wordpress/ "C:/xampp/apps/wordpress/htdocs/" Alias /wordpress "C:/xampp/apps/wordpress/htdocs" Include "C:/xampp/apps/wordpress/conf/httpd-app.conf"
C:\xampp\apps\wordpress\conf\httpd-app.conf
I’m pretty sure this gets overwritten by C:/xampp/apps/wordpress/htdocs/.htaccess? (so no need for rewrite rule)<Directory "C:/xampp/apps/wordpress/htdocs"> Options +MultiViews +FollowSymLinks AllowOverride FileInfo Options <IfVersion < 2.3 > Order allow,deny Allow from all </IfVersion> <IfVersion >= 2.3> Require all granted </IfVersion> </Directory>
C:\WINDOWS\system32\drivers\etc\hosts
127.0.0.1 localhost
Other Info:
- I know the gateway (110.22.25.35) is correctly forwarding because non-WP pages are correctly displayed
- I figure i need to somehow stop wordpress mapping external requests to
127.0.0.1
, but don’t know how to do this without breaking everything. - Perhaps using VirtualHost, ServerName or ServerAlias somehow?
Any ideas would be greatly appreciated.
- The topic ‘Can't access localhost from Internet using multisite subfolders’ is closed to new replies.