Unwanted redirect seemingly without reason - wordpress

so I had recently been messing around with creating domains and such I registered a few and I am having a problem where no matter what the situation, even if apache2 is plain turned off, it redirects to the other domain.
I had installed wordpress on this and I will be the first to admit I was pretty careless, I removed it without much checking and forethought and now it appears to have come back to bite me.
The problem:
When I go to www.example1.com it redirects me to my other domain of www.example2.com. HOWEVER, when I go to www.example3.com it works perfectly fine, same with www.example2.com, it is only when I go to www.example1.com that it always redirects to www.example2.com
This happens regardless of if Apache is running or not.
Furthermore I have reinstalled apache (purged) as well as purged the /var/www directory
I have also been through iptables to see if that is the issue and no dice, I have also checked the dns routing on my host to make sure that I didn't accidentally set up a redirect there and it points at my ip as it should be.
Any help or suggestions of what to do would be greatly appreciated! Thank you

It appear's that due to the way wordpress caches its redirects in the browser cookies I was getting a ghost redirect and there was in fact nothing wrong with the server. Simply had to clear the browser cache
(edit: wrong term)

Related

Difficult situation with domain under VestaCP

Let's say I have domain sxz.me.
Hostname is sxz.me, server is up and running. Unfortunately when I was typing in address sxz.me, it automatically redirected me to IP address 141.xxx.xx.xxx.
My point was to make it as domain name, not IP address. So I changed something in VestaCP that didn't work.
As a next idea, I have installed a plugin, which was redirecting IP address into sxz.me .. It worked! It started redirecting 141.xxx.xx.xxx into sxz.me. The problem was that sxz.me still didn't work e.g. didn't read files uploaded through ftp.
Then I've got genius idea of resetting the server from hosting support. I did it and then for whatever reason WordPress admin panel from 141.xxx.xx.xxx stopped working. I couldn't access it.
I've changed everything in VestaCP in the way described in this video.
Before it was also changed similar, but some parts were missing. We were waiting for DNS propagation and unexpectedly sxz.me started working! Almost there, but problem was that I still couldn't copy files from 141.xxx.xx.xxx by plugin, because of no access to WP admin.
I know there are also different ways, but that was my first idea. In the meantime I've started installing WordPress according to config.php from zero on 141.xxx.xx.xxx and website gone again! It just crashed somehow and started redirecting me once again to 141.xxx.xx.xxx so I'm completely confused and don't know what to do.
Domain doesn't work at all.

Multiple sites on same server and issues with SSL

A number of months ago I created the site cascocc.com. All is well. I then created another site coloradospringshomebuilders.com. All was well, I started development.
I then got an SSL for cascocc.com and installed it, all was well. Some items were not being delivered using SSL so I used the plug in force SSL to get the fancy green bar to show up.
Now coloradospringshomebuilders.com redirects to cascocc.com and I can not figure out how to fix it. I have reverted all my htacess files to the most basic possible. Am I missing one or what am I missing?
Any ideas?
EDIT: I deleted ALL .htaccess files on the entire server. The second site is still redirecting to the first and trying to use the firsts site SSL cert. I do not understand how this is happening
1st sites .htaccess file
2nd sites .htaccess file
This problem sounds like your Virtual hosts are not setup correctly. The SSL setting is overriding any other setting and redirecting to the page that is setup with SSL.
That can only be solved in the server settings (in this case most likely the virtual host). Depending on where you host your sites you might not have access to this, so I would advise to direct this question to your hosting provider.
This whole "redirect" is happening before the server reads the .htaccess files, that's why you can't solve this problem there.

cPanel - send 404 to a php page?

I have an issue in a WordPress site on Hostgator where the htaccess file keeps disappearing. Before you get all, "Check your plugins, dummy" I have the same install of this site running on a completely separate Hostgator account and it's running fine. Furthermore, I have a local instance which, again, is running fine. So if it was a plugin, the issue would be replicated on the other instances, but it's not.
My suspicion is someone who has access to the hosting account is tampering with it. While that sounds paranoid, I can't rule anything out because htaccess files don't just delete themselves.
The bandaid fix has been to just reset permalinks once the site goes down. Annoying, but simple. What might be even neat would be to set my server 404 page to a php script that, when accessed, hits an endpoint I set up in WordPress to programmatically flush the rewrite rules, thus restoring the htaccess page, and then the 404 tries to forward them on again. However, the suggestions on how to do this say putting the error page definitions in the htaccess page. Which doesn't do me much good if the htaccess page is being deleted.
How stupid is this idea? Please let me know in comments.
I'm open to other solutions, but I'm waiting on my hosting support to figure out how the file is being deleted because I assume others with the account info of tampering.

How can I solve the OpenShift Wordpress installation certificate and hence the https permalink issues?

I've migrated my Wordpress blog to OpenShift recently. It works perfect until when you try to add a custom domain alias to your installation.
The OpenShift URL for my blog is blog-latifetunc.rhcloud.com
I added the following URL as alias: blog.latifetunc.com
(Sorry I couldn't attach images since I don't have enough reputation points. Instead I put links to images. This is my first question in StackOverflow.)
http://www.alpertunc.com/q1.png
I successfully added the CNAME record for my domain to point blog.latifetunc.com to blog-latifetunc.rhcloud.com in GoDaddy
http://www.alpertunc.com/q2.png
The problem pops up when I try to reach my blog with this alias. It says:
Safari can't verify the identity of the website "blog.latifetunc.com".
The certificate for this website is invalid. You might be connecting to a website that is pretending to be "blog.latifetunc.com", which could put your confidential information at risk. Would you like to connect to the website anyway?
(I can't even post more than two links without 10 reputation points :( So please put the above URL in front of below images as well.)
q3.png
If you click "Continue" it works fine but this alert is very scary for many users. I searched for hours for a solution with no luck. I considered buying a security certificate as well but then I thought this blog was working with an alias in its previous installation too. However we never had such an alert in browser while visiting either via the main domain or the alias.
The previous installation was on IIS and the binding were as following:
q4.png
Then when my brain was about to explode I found out that the alert is due to https. When I checked Settings from my Wordpress dashboard I realised that somehow OpenShift installs Wordpress on https and sets the permalinks to https.
q5.png
In fact whatever you type that points to *.rhcloud.com is converted to https. I know that because I added the CNAME for www.latifetunc.net to point to blog-latifetunc.rhcloud.com as well but didn't add the alias in OpenShift Applications. So www.latifetunc.net resolves to blog-latifetunc.rhcloud.com but since there is no alias defined (hence there is no vhost entry in Apache) it gives error. But even that error is in port 443!
q6.png
My main problem is to get rid of the certificate error while visiting my blog via my alias domain name. I really appreciate any help on that one.
My related question is that why on earth permalinks start with https on OpenShift Wordpress installation? If I can solve that, probably I'll solve my main problem as well.
Thanks a lot!
I checked blog.latifetunc.com on safari,chrome,firefox, and opera and I didn't get any warnings so you much have figured out a solution. However for others who may stumble across this I've provided some information:
By default OpenShift applications accept traffic on both http and https. So if you're wanting to have a custom domain but aren't worried about ssl than you can simply just use the http connection to your application (http://myapp.com). If you are wanting to apply a SSL certificate and you're on one of the plans that allow it (bronze or silver). The documentation to apply it, is in the SSL Section of the OpenShift Online User Guide.

How to forward domain to meteor deployed website (using GoDaddy)?

This seems simple enough, but its not quite working.
I have a website deployed at website.meteor.com and it seems to work just fine.
I have a domain name, website.com with GoDaddy. There's some weird business with the www that I'm unclear about, but it seems I'm "forwarding" website.com to www.website.com. I had no idea there's a difference. Anyways, I think (hope) this is unrelated.
In my Domain, DNS Zone Files, I set the CNAME (alias) to point to website.meteor.com. This didn't work. I get that the meteor website is down. But when I go to website.meteor.com, it seems to be just fine.
I realized that www.website.meteor.com doenst work, so I suspect maybe thats the issue?
In my CNAME (alias), I realized that HOST is www so maybe thats the issue. I deleted that, but then I couldn't save with no host. It says the host is the "subdomain in which the record applies", whatever that means. So I tried putting website there, "Points to" meteor.com. Well that didn't work either.
Hopefully there something very minor I'm messing up here.
OK, I figured it out.
Host: "website"
CNAME: "origin.meteor.com"
Thats not enough though. I've already deployed to website.meteor.com but it doesn't show up.
You then have to mrt deploy www.website.com.

Resources