Google indexed some pages with https and some with http - .htaccess

after 2 years of development of my site I found out that google for some products index with https (I dont have certificate, so people got warning that its insecure connection) and some products with http.
Can you please help to solve that ? Do you think that simple 301 redirect from https to http will solve it ?
For example one my product
http://affgadgets.com/ontraport-crm (that should be)
https://affgadgets.com/ontraport-crm (and this works too!)
Also I found out that if I type link like this /onTRaport-crm (with huge letters) it will work too. This is simply some htaccess issue or something like that.
Thank you!

Related

Tracking htaccess redirects?

is it possible to track htaccess redirects (without Google Analytics)? I would like to know how many people visit a certain (redirect) URL.
The use case is as follows:
The folder 'links' on my server has a htaccess file in it with all the redirects.
I would like to know how many people visit 'links.DOMAIN.com/topic' and, thus, get redirected to https://somethingelse.com.
We don't use any Google products. Analytics would otherwise be the obvious choice.
I'm out of ideas, tbh.
Thank you in advance! :)

DNS: Unable to forward to 'external' domain

Maybe the title is a bit cryptical, but what I'd like to achieve is: when people end up with a link that ends on .com, it's permanently pointed / redirected to the .nl version. I thought it should be quite simple, but it tackled me completely.
Maybe I'm just overlooking something, so I could use some help from you guys / gals :-)
The first thing that I have to mention is that most of the traffic is pointed to a Lightspeed HQ e-Commerce server, where our webshop is running. Besides that, we have a small (inactive for the moment) blog, which should be accessible through a subdomain. The same for the e-mails and access to the webmail environment.
The main-domain is sceneryworkshop.nl
The 'add-on' domain is sceneryworkshop.com - which should be forwarded to sceneryworkshop.nl.
Our hosting company is using Plesk, that I'm not quite familiar with. Certainly not the DNS-settings page. At first I was searching for a 301 solution, but couldn't find any of such thing. After that I tried tinkering with CNAMES, which didn't resolve many, because of conflicts with the 'Glue record for the domain'
Btw. pointing the .com to the same IP-Address gives more trouble with logging and a legit SSL certificate from Lightspeed HQ.
Anyone who could point me in the right direction based on my given info?
Thank you very much in advance for thinking with me!
If you are able to get the full url in php, and split the url by a ".", and check if and only if "com" is the last string, by writing an if-else statement, and redirect the link if it is true
url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";

Website requires www. prefix?

This isn't really code related, but at the same time it seems like the right place to ask. It's not happened to me for a while but a friend mentioned it in conversation earlier and now I need to know because it's bugging me!!
There are certain websites that require you to put in a www. prefix to actually visit their site. so as an example if I typed in domain.com the page wouldn't be found, but www.domain.com works perfectly fine. I can't think of any real examples which is frustrating me, but it happens every so often! I also see www1.domain.com occasionally... Not sure what that means either!
Could anybody explain these to me as I cant make any sense of it!
Thanks!!
This is because the dns or host files are configured that way.
If you configure the dns to only respond to www it will ignore all other requests for your domain.
If you configure the host files without a "catch all" you will have the same behavior.
I usually use a global dns record to redirect all requests without a specified domain prefix to a default server.
And on my servers I usually have a "catch all" rule to redirect unfamiliar requests to the root of the main website.
That always depends on how the name was configured - you can configure DNS-names pretty freely.

Implications of not forwarding http:// to http://www

my company is running IIS and DNN (I'm not a server guy, so color me ignorant), and I've read previous that you should either redirect your .http://www.mydomain to .http://mydomain or Vice Versa. Can anyone give me reasons to do this? (periods "prepended" to remove href)
From what I understand, it's because search engines see those as two different 'sites' (Even when visiting one or the other, I can be logged into one but not the other).
I also heard it can be a duplicate content problem, which search engines dislike.
Just looking for some professional insight, will help me and others.
Thanks!
This allows your site to be more SEO-friendly. Search engine crawlers will view these as two different URLs. That will cause your site's ranking in search engines to have multiple rankings for the same content.
ScottGu describes the problem and how to go about fixing it in a blog post:
http://weblogs.asp.net/scottgu/archive/2010/04/20/tip-trick-fix-common-seo-problems-using-the-url-rewrite-extension.aspx
Although it's mostly for SEO, there is also a potential usability issue in that a user who logs in on www.domain.com may get cookies that only work on the www subdomain and will be forced to log in again if they ever follow a link to domain.com (without the www prefix).
In addition to the SEO-friendlyness this also prevents some errors that might come up when both, with and without www works.
for example a user could login on www.yourdomain.com and would receive a cookie. later he visit your site via yourdomain.com and the cookie would not apply there.

IIS, Redirecting and HTTPS

I have an interesting issue with HTTPS ports not being handled properly. It is a relatively small issue and I bet it is pretty simple to solve, I am just not thinking of it.
We have a website served with IIS 6, www.mylongdomainname.com. We have a secure portal which is handled via https://www.mylongdomainname.com. Now we have several vanity and marketing URLs that we use over the phone like www.shortname.com, etc. I have two websites setup, one that handles all request with the header www.mylongdomain.com which actually serves the website. The other accepts any traffic and permanently redirects to www.mylongdomain.com. This way if we ever add any more domains, they will all end up at the one, also it redirect mylongdomain.com to www.mylongdomain.com.
Everything here works fine. The issue now is when I google "shortname.com," the first result returned is the same as if I were googling "mylongdomain" however, google has been able to crawl the other pages via https://shortname.com and index them that way. We dont have SSL certificates for these other domains, so when you click through, you get a nasty un-trusted error.
This really wouldn't be an issue if we didn't use these URLs over the phone, and you all know how many people don't know the difference between the URL bar and a search box.
any suggestions or tips?
I'd set up a redirect so that https://shortname.com is sent to http://shortname.com with a 301 (permanent) redirect. This will put an end to the nasty untrusted error immediately. Furthermore, this will also cause Google to slowly but surely update their index.
There are multiple ways to do this. If you're using IIS7 you can use the URL Rewrite Module and write a redirect rule to take care of it.
Or if you're not on IIS7 it may be perfectly acceptable to write some code to accomplish this. I wrote some ASP.NET I've used plenty of times to take care of this HTTP/HTTPS redirection. In your particular case you could simply take my code and call SetSSL(False) in the Application_BeginRequest function of your global.asax.

Resources