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]";
Related
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!
At first my website was hosted on 000webhost.com but then I had some problems with them so I switched for networksolutions.com(paid).
But after a while I realized that when I entered on www.gstbox.com it showed me that the page is not found but if I typed in gstbox.com it works just fine what could possibly be the problem??
Please help
there have been a lot of these questions answered here please use the search box in the top right corner of the page, most can be answered with a rewrite rule. here is the answer to your question. Www and non www sites
Or possibly there might be a firewall and its not allowing the www.gstbox.com to pass,or else maybe your web service is not configured to respond to the same page on www
The problem is that www.gstbox.com is a subdomain of gstbox.com which is simply not listed in gstbox.com's DNS server. You should have some kind of control panel for your domain (if you don't, contact an operator of your service provider) where you are able to change the DNS settings. You should add a www subdomain and configure it to point to the proper IP address (most likely the same as the one gstbox.com points to).
I hope it helps,
Regards
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.
There has been a question made towards me recently to do the following:
We have a website with Drupal running in IIS.
On that site is an URL Redirect to a website hosted externally, obviously with a name completely irrelevant to the name of our company.
The question now is the following;
They want to change to URL to a subdomain of our website. Example: from "www.external-site.com" to "www.sub.internal.com" (while still showing content of the external website)
They want the current page of that website to be reflected in the URL bar. So it wouldn't say "www.sub.internal.com", but it would say "www.sub.internal.com/solutions/page1.html" (instead of "www.external-site.com/solutions/page1.html")
It's possible that I forgot another 'condition' but have mentioned before this.
So, if someone visits through our URL Redirect to External-website, it needs to show our subdomain instead of their domain in the URL, AND it needs to show the current page when people start browsing while still using our subdomain in the URL.
Now, I checked the external-website, and it seems that most of the links available are relative links (if this would be any useful information).
Currently, the external website is hosted externally, and will remain to be so for next few years. (I believe we bought the company)
I have been asking around and looking up, and the best possible thing seems to use domain forwarding, but even then it still doesn't seem to comply with the entirety that they asked of me.
I am but a 'simple' .NET programmer, held responsible to do support for anything involving the websites, and I can't say I have extended knowledge about infrastructure. (But I can ask people to do this for me)
Is there anything that could solve this?
Thanks so much!
IIS's URL rewite and Application Request Routing (ARR) combo can help you what you want to achive. Here are few links which may guide you to configure ARR. Please note that these links dont exibit exact solution to your problem however you can take clue from it and fabricate your solution accordingly.
http://www.iis.net/learn/extensions/url-rewrite-module/reverse-proxy-with-url-rewrite-v2-and-application-request-routing
http://www.iis.net/learn/extensions/url-rewrite-module/reverse-proxy-rule-template
It sounds like you'll want to use a full-page iframe: do not redirect but show a page with an "inner page" instead: that inner page is the external web site. That way, users do not see the external site in their URL bar.
http://webdesign.about.com/od/iframes/a/aaiframe.htm
You need to configure the equivalent of Apache Virtual Host with Reverse Proxy on IIS.
See this answers:
https://serverfault.com/a/271030
and
https://stackoverflow.com/a/10003306/2131693
I have a small issue. I have tried for the last hour to find a solution for this on this and many other websites. I have found similar but none have provided an answer that works. Heres that problem:
I have a badge on my website that was given to me by Norton online protection. they provided me with a script file and I placed it where it should go. NOW, this script is registered to "www.example.com" but if someone goes to their browsertypes in just "example.com" without the WWW. the Norton badge never shows.
I spoke with Godaddy this morning and they have no solution so that's why I'm asking on here.
Is there a to send a domiain name to the same domain name? so that it always shows the WWW?
Configure your webserver such that www.example.com is one site (your actual site with your content), and you have another site that is example.com (no www subdomain) as a site that you can now configure to redirect to your actual site. How that step is done depends on which webserver you are using, but basically these is a way to do that on any webserver (Apache, IIS, etc).
You could try to read the URL and check if 'www' is present in the URL. If it is not present redirect the visitors to www.example.com
In php you could use the below for redirection
header('Location: http://www.example.com/');