Wordpress on WAMP: Need to change site looking for assets on localhost - wordpress

I have a wordpress site hosted on WAMP on my local PC. I want other people on my network to view this website but when I tested it from another PC none of the stylesheets, scripts etc are being loaded. I troubleshooted it and found this is because it's looking for those files on localhost. How can I change it to look for those files relative to the folder? Thanks

What you have done is a bit like moving the site to another domain. Because WP records the domain name in its database when you install it, it thinks its domain is localhost.
Now you are getting to it by lets say using your ip address 192.168.0.10 this is considered a new domain name and when it attempts to server various resources it is still using the original domain name of localhost it cannot find those resources on the other PC's.
You can find out what you need to do here on the worpress site Changing the site url

I solved this by using my IP address as the site path in Wordpress/Settings/General

Related

Acessing WordPress locally on different network

I've been having trouble accessing my local wordpress project on different network. The site just keeps loading, and I can't even access the admin panel. I inspected the net panel. It's showing this IP instead of 'localhost' or my real local IP. Since I'm new to wordpress I would like to hear some solutions to this problem.
EDIT: The problem was in the Database. That IP was stored in options table.
I used interconnectit to change the '192.168.0.12' to 'localhost' and I can confirm that it works now.
To run wordpress on your local pc you should have a server installed, for example wamp server.
If this step is fine, make sure that you are masking correctly localhost with this ip at hosts file (C:\Windows\System32\drivers\etc).
Finally, if you are moving wordpress from another location, make sure that all db records (especially on wp_options table) have the url changed.
For sharing project hosted localhost over network, you can use Ngrok

need assistance on my local wordpress

I just finished building my basic website using wordpress and wamp. installation directory is at C:\wamp64\www\wordpress and i'm currently accessing my site at localhost/wordpress
now i have 2 problems:
1. how can i trick my localhost to use http://www.tracking-site.com instead of localhost/wordpress? I tried changing site and wordpress address but all i get is page not found.
after changing my url, i am planning to access my local wordpress (which will now be http://www.tracking-site.com) from another PC.
2a. do i need to copy all the wordpress files to pc#2?
2b. do i need to install wamp to pc#2?
edit: i can skip problem #1 if changing site url is not important. cause my main target here is to access my localhost wordpress from another PC with same LAN. I tried adding tracking-site.com in hosts file to redirect to 127.0.0.1 then in PC#2 added in hosts file 192.168.x.xxx (my ip) then tracking-site.com. not working tho.
I don't want to host it online because my website will only be used internally in my workplace.
This should work, haven't done it in Windows in forever.
Set your site to a different URL, this is probably a bad idea honestly since WP hardcodes a lot of urls like the images, you can get past this by using wp-cli.phar to search and replace in the db but that's not a simple procedure either.
That being said it can be done.
Right click Notepad and open as administrator.
Click Open and change the file type to all files.
open the following file: c:\Windows\System32\Drivers\etc\hosts
Add the following line: 127.0.0.1 www.tracking-site.com
Question 2. Is answered here: How to access my localhost from another PC in LAN?

Website preview for a wordPress based site on a development server

I have created a demo website for a client. I installed the site on the client's live domain name and I used the etc/host DNS trick to point the domain to my development sever. Now I want to send a live preview to client for validation but I don't want to bother her with technical details such as modifying local computer host file. The client doesn’t want to switch the domain to the new site either, until everything is ready as the site is highly active. I have tried the cpanel temporary link (mod_userdir is enabled) but it breaks everything including styles and scripts. Do you have any solution. Thanks.
Update: I have found this site if it can help nodns.io, they only need the emulated domain name and the development server IP.
You can still use the temporary URL and that is the easiest way. You just need to make a change in the WordPress database. You can go to cPanel -> phpMyAdmin, open the database and look for the _options table.
Once you find it, you need to change the home and siteurl options to the temporary URL:
https://codex.wordpress.org/Changing_The_Site_URL
You can follow the "Changing the URL directly in the database" directions.
Goodluck!

WordPress multisite network with non-wp site at domain

I want to set up a multisite network using subdomains under a domain that is used for a non-wp site.
so, for example, we want our domains to look like:
blog1.mysite.com
blog2.mysite.com
but mysite.com points to our main site that is not built with WordPress and is not part of this network.
I'm not sure what to do here since the main domain, site.com in this case, typically points to the root blog on the multisite network.
I suspect this is common and there is a simple solution but I'm not sure where to start.
Update (unresolved) :
I've had a little bit of luck working on this locally but I'm still not out of the water...
my dilemma… I need to set up multisite with subdomains under a domain that is not part of the network? So basically, we have our main site: mainsite.com
and we want to set up a network with subdomains like site1.mainsite.com and site2.mainsite.com.
mainsite.com, however is not a WordPress site and is not part of the network. so If I set the network up under multisite.mainsite.com, then new sites subdomains are created with that as the subdomain like: site1.multisite.mainsite.com
but if I set the current site to mainsite.com, then all of the network admin links break because they point to our main non-wp site.
So, here's what I've done, which kinda works (I'm doing everything locally with my hosts file so I won't know for sure until I get it on a dev box) ...
First I pointed mainsite.com to my local ip in my hosts file and set the network up under mainsite.com
Next I successfully created two sites. multisite.mainsite.com and site1.mainsite.com, through the network admin panel
Then, I changed the 'current site' in wp-config.php from mainsite.com to multisite.mainsite.com and I removed mainsite.com from my hosts file.
Now, I can go to mainsite.com and land on our primary website; I can go to site1.mainsite.com and land on the wordpress site on the network; and I can access the network-admin-section under multisite.mainsite.com
The problem is, since the current site is multisite.mainsite.com, if I try to add a new site to the network, the domain will be site3.multisite.mainsite.com instead of the intended site3.mainsite.com
So I still haven't found the correct solution here but this might help explain my problem a little better
Ok, I figured it out... I didn't realize previously that you can manually change the site url in the site edit screen. Here's a write up with more details: http://georgespake.com/create-a-multisite-network-using-sub-domains-under-an-existing-domain/

Site will not load. Why is ":4001" showing up in my browser's address bar when this happens?

I've migrated a local install of Wordpress to my host.
Now, when I attempt to load the site (ex. "www.mynewsite.com") the browser will churn for a while, then report that my site couldn't be loaded because it's taking too long to respond.
I notice that the address bar of my browser now reads: www.mynewsite.com:4001
What does it mean when ":4001" becomes tagged on at the end of your url?
What was your basic wordpress configuration? You need to set the website address in the wp-config.php while moving your wordpress website to a new host. This is just because when you install wordpress on localhost it takes the 127.0.0.1 as native path, what you need is to reconfigure the configuration file, it looks like your local setup ran on 4001 port!
:4001 is your port number, it looks like your site was developed on that port, connect to your website's database and edit your WP installation's options table (default wp_options) update entries siteurl and home (usually entries 1 and 37 respectively) to your new url.
if you were developing locally using a host name identical to your live site you will need to disable the host name so you can view the live site.

Resources