Hosts file ignoring only one mapping, Mac Big Sur OS - wordpress

I was wondering if have any thoughts/suggestions.
I am moving a site onto a new hosting and trying to preview it using my hosts file. I'm being redirected to https in all browsers - Safari, Chrome, Firefox, Brave. This is a static site with a WordPress news section.
What I have tried:
confirmed the IP I'm adding to hosts file is correct
cleared the dns cache
viewed in incognito
made sure the hosts file is not being ignored - another site I am viewing is working fine + I pinged the domain and it returned the new IP address I am trying to view but I am still being redirected
redirects are commented out in htaccess
enabling a test domain in the c panel which is also redirecting me to the live site, even on Tor
it works on my colleague's Windows machine.
Do you have any more quick ideas/thoughts as to what may be causing this? I am out of ideas now.

Related

Browser ignores the url path on the first load

I have a Wordpress site that is migrated to a new server. Along with the migration, it now also has a subfolder /en which is a different version of the website targeted for international audience. The problem I am facing is that if I try to load the site example.com/en, on the first load it redirects to example.com. But if I load example.com/en on the second try it goes to the subfolder website. And it is browser specific. I have this problem on Chrome and Safari but not on Firefox
I have already tried clearing the cache in the CMS level and also on the browser, this hasn't helped in any way. Could it be because of DNS switching from older server to the new server?
Thanks
Here are some ideas on how to find the root of the problem:
Check the site from a different network / device to make sure it's not the DNS cache
Check the .htaccess file of the server, maybe theres a misconfiguration
Use a site like this one to trace the redirect
If nothing helpes you could just wait a few hours, maybe the DNS servers take some time to update all the settings.

403 forbidden error when accessing one website only via my home wifi. How to fix?

Only get the error when trying to visit the site via my home BT wifi, any browser. Have tried restarting the router, disabling cache in inspect element and clearing all cookies and caches in Chrome and Safari settings. Can access the website via 3g/4g and from my office and friends computers.
Please help as I need to make some updates in Wordpress
Go to your wordpress folder and delete .htaccess file. That is problem usually.

Website showing error when accessing it

I installed wordpress on my website. Uploaded a nice premium theme for ecommerce. But when I try to access the website then it shows an error. An image of the error is shown below. What can cause this error? The website was working fine. I mean to say that there was a "Coming Soon" shown on the website when I used to go to my website url. But after I installed wordpress, it's showing this error. I installed wordpress in the root directory, i.e I kept the "in dir" field blank while installing wordpress. Moreover, I did only one more change except installing wordpress is that I changed my cpanel password. These are the only two things I did and the website shows this error. Help will be appreciated.
Edit: I just tried to access my website on my phone and it is showing the website but on desktop, it takes to an error page: http://mysitename.com/cgi-sys/defaultwebpage.cgi rather than http://mysitename.com
The page is most probably cached on your computer/browser or you have DNS cache and it points your domain name to some other ip address then the correct one.
Try using a different browser. Try using a private navigation window from your browser (it works with Firefox, Chrome).
If you are using windows try deleting your dns cache by going to Start -> Run -> cmd.exe then type this command and press Enter:
ipconfig /flushdns

wordpress website is being redirected to some other website

I set up my blog with wordpress cms few days ago and it was working fine, url is blog,I also noticed that it only happens only on few network connection.for e.g.: it works fine on my mobile data pack and wifi connection but in my office it got redirected to some other web page.
How and why it is happenings have already checked .htaccessand dns
and found nothing suspicious.
Seems to be working correctly. Check with your office's network administrator.
Additionally, scan your files for any spam injection.

MAMP PRO testing local WordPress website with xip.io over LAN from iPhone not loading images css correct links etc

Hiall,
I’m trying to simply test my local MAMP PRO wordpress site on my iPhone through my local LAN network.
I test my on my Mac via the URL which works fine
http://mysite:8888/
For my iPhone
If I go to MAMP PRO select my website/host from the left column and check the via Xip.ic (LAN only) option/checkbox
it provides a URL which is
http://mysite.10.0.1.6.xip.io:8888
I then send myself an email with this link which I click from the iPhone
When I load http://mysite.10.0.1.6.xip.io:8888 in my iPhone, the URL loads and I can see my website but there is no images, or CSS styling, the sites links are not correct and I only see the sites text.
I understand I need to change the site to load like its loading from mac to my iPhone urls and that I can change the
WordPress Address (URL)
Site Address (URL)
without having to do it in the wp-admin settings screen by adding by doing
define('WP_HOME','http://mysite.10.0.1.6:8888');
define('WP_SITEURL','http://mysite.10.0.1.6:8888');
but this does not make a difference either
I’ve also tried
define('WP_HOME', 'http://mysite.10.0.1.6.xip.io:8888');
define('WP_SITEURL', 'http://mysite.10.0.1.6.xip.io:8888');
I’ve found various examples like
https://wordpress.stackexchange.com/questions/98386/testing-local-server-with-mamp-wordpress-on-mobile-device
http://www.designshifts.com/view-local-wordpress-website-on-your-iphone-or-ipad-with-mamp/
which I have spent hours trying to replicate but I just can’t figure it out!
I’m not sure if it’s because I’m typing my urls / ports different/incorrectly and typing my URL’s incorrectly to include ports etc, or because I have the latest version of MAMP PRO and Yosemite and these examples are a few years old etc, or maybe I need to be clearing the the word press / MAMP cache, restarting on every atempt etc?.
Any help would be greatly appreciated!
If you already have replaced the home and siteurl in the General Settings. Note: Wp-config alternative hack as you mentioned didn't work for me.
In Mamp Pro, select your host e.g. (example.dev).
Check "via Xip.io (LAN only)
Under Alias Name, Add your system's static IP (e.g. 192.168.15.4). Default settings will work
Save and Restart servers.
Your Images and CSS should appear. BUT links are still not working. I hope you'd help me improving the answer.
In the Wordpress settings, change the below:
define('WP_HOME', 'http://mysite.10.0.1.6.xip.io:8888');
define('WP_SITEURL', 'http://mysite.10.0.1.6.xip.io:8888');
To your device local network I.P. address, for example:
define('WP_HOME', 'http://192.168.0.71');
define('WP_SITEURL', 'http://192.168.0.71');
This will work!
To be honest, the simplest way I have found is to just go into your database and look for siteurl and home which are normally record 1 & 2 in the database, and update it to your network IP address.
It can then be visited in the browser from that IP address for anyone on the network.
Wordpress just isn't built to make xip.io work because it defines the site name statically.

Resources