Some other domain is redirecting to my wordpress website - wordpress

My website was running just fine then one day i found some other domain was redirecting to my site. whenever someone go for that domain url that redirects to my site.
the problem is the other domain is not even registered. that was registered years ago and that owner had clients on that. but he gave to that domain and domain is free since then. but now a days that is automatically redirecting to mine. whenever my posts update, RSS feed is sent to that domain's client.
the other domain owner has nothing to do with that because he is no longer the owner and can not help.
I tried to update .htacces and defined the rules to not accept that url but instead it always show error that too many redirects because if that domain is restricted it tries again and again due to which my site goes down..
how could i overcome this issue?

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 to access the home page of WordPress from a cPanel staging URL

I have a cPanel hosting package, and the staging url is this format: https://cpanelserver.com/~cpaneluserid/.
This does take me to my WordPress site. However, it takes me to the WordPress page "Oh no! No content is appearing for this page!".
Obviously the /~cpaneluserid/ part of the staging url is not recognized by WordPress as a valid page name.
If I try to tack on an interior page name like this: https://cpanelserver.com/~cpaneluserid/about-us/, I still get an "oh no" unrecognized page error.
I don't reach my website if I try removing the the cpanel userid from the url like this: https://cpanelserver.com/ or remove the tilda like this: https://cpanelserver.com/cpaneluserid/.
Has anyone been able to use a staging URL with a WordPress website from cPanel hosting with this same URL format?
UPDATE:
Because my cPanel 'staging URL' has the user-id as a sub-directory, as in
this format: https://cpanelserver.com/~cpaneluserid/, that means
that no one with a WordPress site will be able to use this staging URL format.  That is because WordPress interprets the /~cpaneluserid/ as a page name.
And trying to navigate away from this invalid page (page with no content) doesn't work, as this coding: <?php bloginfo( 'url' ); ?> will always return https://cpanelserver.com/~cpaneluserid/, so the new page link will give you this URL: https://cpanelserver.com/~cpaneluserid/newpage/, showing the 'newpage' as a sub-directory of this invalid page '~cpaneluserid'.
Instead, the hosting company should be creating the staging URL with the user-id as a sub-domain, as in this format:
https://cpaneluserid.cpanelserver.com/.
I just heard from my hosting company, and they had this excuse: "Unfortunately we are not providing a staging URL on the cPanel platform due
to the number of potential security risks that are associated with it."
So basically no-one with a WordPress site on a cPanel hosting package can show their clients their website design, to get their approval, before they go live.
I am not sure why the hosting company thinks that this url: https://cpanelserver.com/~cpaneluserid/ is any less risky than this one: https://cpaneluserid.cpanelserver.com/?
So it looks like there is no answer for this post.
But now I am curious how other cPanel hosting companies deal with this 'security risk' of having a valid staging url.. or do they all use the same format as mine?
 
I finally solved the problem.
It turned out to be a rooky cPanel user mistake!
I had used the cPanel server name for the WP_HOME and WP_SITEURL WordPress settings (ie: https://cpanelserver.com/), instead of the actual location of my hosting package on the cPanel server (ie: https://cpanelserver.com/~cpaneluserid/).
The way I had the settings meant that WordPress ignored the part of the URL that was the defined as the siteurl (ie: https://cpanelserver.com/), and treated everything after that as a page name (ie: /~cpaneluserid/).
So when I used https://cpanelserver.com/~cpaneluserid/. to view the site online, the cPanel hosting package correctly got me to the root of my website location, but WordPress didn’t take me to the home page, instead it took me to the non-existent /~cpaneluserid/. page.
If I had gotten the server name wrong in the WP settings, then I would not have been able to see my site, and would immediately know it was an issue on my side, and would have figured out this issue sooner.
But since I had the server name correct (even though the url was incomplete), I was able to view my site, and know that the database was correct.. so I erroneously thought that my WordPress settings were also correct. Instead, I was thinking that the page presentation & navigation issues where a problem with cPanels temporary URL format.
So in case anyone every has the same problem, I wanted to document it here.
IF you are using your cPanel's staging (or temporary) URL to access
your site before it goes live, then BE SURE TO use the full URL that
points to your cpanel hosting package - which should include your
cPanel user ID as in: ‘https://cpanelserver.com/~cpaneluserid/’ in the
WordPress settings of WP_HOME and WP_SITEURL.

Bad Links resolve

I am using wordpress to create a website. I have shifted my website to new domain but i have used the backup of old domain name.
now the old domain is not owned by me someone else has booked it. i am trying to apply for google ads but every time i try to apply they reject my request due to bad links.
my previous domain was .com now i have .com.au domain, report shows bad links associated with old domain.
can anyone guide me how to remove these links

How to redirect to another sub-domain using IIS?

I have changed my domain name from (www.example.com)
to (in.example.com)
the issue is that all old facebook links and campaigns links redirect to the old domain which will show an error due to the change of the domain.
and I am really not good with IIS rules, I have searched on how to make rules to handle this but I could not make it.
all that I need is very simple: if the user open http://www.example.com/Vehicle/all
it should redirect him to
http://in.example.com/Vehicle/all
if the user visits the direct domain it should not remain on the same original domain: http://www.example.com
You Can do redirection from your cpanel. you will find redirection under Domains section

Share session between my site and wordpress blog

I would like to know how to share a session between my website non-wordpress and my wordpress blog on the same domain www.mysite.com, so that when a user is logged in to my site he's also logged in to the blog
I installed wordpress as subdirectory on my site, url for my site is www.mysite.com and I access wordpress like this www.mysite.com/wordpressBlog
On my user_login.php in my main site I activated
session_start();
to activate cookies and on my wordpress wp_unregister_GLOBALS() I added
$no_unset = array( '_SESSION', ...
But nothing happen, when I login to my main site I still have to login to the blog
as a matter of fact my site and wordpress blog are on the same domain. I installed wordpress as subdirectory on my site url for my site is www.mysite.com and I access wordpress like this www.mysite.com/wordpressBlog On my user_login.php in my main site I activated
session_start();
to activate cookies and on my wordpress wp_unregister_GLOBALS() I added $no_unset = array( '_SESSION', ...
But nothing happen, when I login to my main site I still have to login to the blog
In order to be able to share a session cookie between both sites, they will have to run under the same domain name (e.g. mysite.com). The following would be a valid configuration if the session cookie has a scope of mysite.com
www.mysite.com
blog.mysite.com
PS. I don't recommend using Cross Scripting hacks to get around this domain scoping issue. It's limited to a domain for security reasons.
[Edit]
I should also point out that it is entirely valid to have your two sub-domains (sites) hosted on different servers
[Edit]
It is difficult to provide a succinct answer to your question because you are using a non-WP site. My best suggestion for you is to post on the WordPress StackExchange where you may get someone who has done this configuration before.
I believe your issues are centred around the scope of your Cookie from WP. Editing your wp-config.php and setting the COOKIE_DOMAIN to use "" may help with your issue as referred to by this WordPress StackExchange post.
Some posts speak of removing this settign entirely. In any case you need a way to debug your HTTP sessions to see what cookies are being sent using which scope, that is why I recommended FireBug. In any case you're still going to have to re-code your non-WP site to recognise the WP cookies so understanding what's going on is important.
I did come across this other post regarding Multisite Domain Mapping that may help with your knowledge, but this is involved WP sites only so not exactly what you need.

Resources