I have a domain where my code is hosted, and two other domains parked over that domain.
So my code is hosted at domain.com and when I go to domain2.com or domain3.com, the contents of the sites show whatever is hosted at domain.com. The content delivered is based on the url being accessed, so domain2.com would show something different than domain3.com, as I get the url by setting $domain = $_SERVER['HTTP_HOST'];
This works just fine for the http versions of the website, but when I try to access any https versions, it gives a cake error:
URL rewriting is not properly configured on your server. 1) Help me configure it 2) I don't / can't use URL rewriting
That happens on all 3 domains. That page also doesn't have any styling. Cake also can't connect to my database:
Database connection "SQLSTATE[HY000] [1129] Host 'xxx-xx-xxx-x.unifiedlayer.com' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'" is missing, or could not be created.
I've tried looking for that text inside my app folder, to see if I could at least change the contents of that error page, but if I change the text, it doesn't change it in the error page. I've also tried changing all htaccess files, even deleting their content, but that only affects the http versions, and not the https.
I'm starting to think that the https pages are trying to access a different domain that I have, but I don't see how that would be possible.
All 3 domains have ssl certificates and they were all working correctly before I parked the domains.
Any help is much appreciated. I can also provide more details on this issue.
You should do exactly what the mysql error says. Flush the hosts from the main database server. Check you have whitelisted your websites on a firewall/iptables.
Related
I've a server with 3 Wordpress. With one of them, I've changed (add an "s" after http) two URL in General Settings Wordpress Adress and Site Adress.
Since I've do that, I'had ERR_TO_MANY_REDIRECT error. So I've add theses lines in my wp-config file :
define('WP_HOME','http://www.mywebsite.com/wordpress/');
define('WP_SITEURL','http://www.mywebsite.com/wordpress/');
And now I've an error Mixed Content: The page at '<URL>' was loaded over HTTPS, but requested an insecure script '<URL>'. This request has been blocked; the content must be served over HTTPS.
A lot of files (like CSS) is not recognised and I'can't access to my wp-admin.
I don't know what to do and I don't understand why the problem is on my 3 wordpress if I had change that in one of them...
Can you help me please ?
I've found a solution :
Comment my rules for HTTPS in my .htaccess.
Access to my wp-admin ( I can access now )
Install the plugin SSL Insecure Content Fixer
Now I can access to my different Wordpress in HTTPS
When you host a site on secure domain i.e. (https://) you cannot use insecure URL's in your files (http://) so the options with you are you use SSL on other servers as well.
You can try Certbot for installing SSL certificate on your other servers.
I have an eCommerce WordPress site using woo commerce. Now my hosting company "Heart Internet" provide free SSL certs however the map a subdomain to my domain to achieve this.
Real domain http://mywebsite.com/
SSL Version https://web110.secure-secure.co.uk/mywebsite.com/
So this means if I want to use SSL for my checkout page I need to link to this url. https://web110.secure-secure.co.uk/mywebsite.com/checkout
However doing so provides me with the error:
Forbidden
You don't have permission to access /index.php on this server.
Apache/2.4.23 (Unix) Server at web115.secure-secure.co.uk Port 80
So I would imagine this is something to do with .htaccess but I am not sure.
If I go to this url: https://web110.secure-secure.co.uk/mywebsite.com
It actually does display the home page, however minus any images or css styles and my console is full of failed to load resources error messages.
AFter contacting my hosting company they have said its due to how the site itself is configured. But this is just a simple wordpress website, nothing fancy going on.
Does any one know what I can do?
Image of heart internet ssl
To clarify my question is not about css/images not showing up on homepage, its about the fact i cannot reach any other page on my website without getting the error - You don't have permission to access /index.php on this server.
I don't use the same certificat, but with mine
(Free let's encrypt), i have the same url for whole website. I use woocommerce and checked the appopriate option in the woocommerce setting (use ssl for check out).
Does your provider told you to put your files in this folder ?
If so, all your install might be inside and a redirect done to the main domaine name. You maybe need to change files and folder permissions to use it, with your mostly like ftp browser.
I have bought a domain and I want to redirect it to a directory on another subdomain.
Exemple:
A user type www.firstweb.com in the URL bar and he has to be redirected to www.secondweb.com/directory/ but the URL shown has to be www.firstweb.com without iframe.
Other exemple:
www.firstweb.com/contact/ shows the content of www.secondweb.com/directory/contact.php but the URL shown has to be www.firstweb.com/contact/ even after the redirect.
Both domain and servers are hosted by the same company (OVH).
I don't know if it is understandable but I dont know how to figure it out.
Thanks a lot for your help.
J.ROX
You can do this by installing NGINX (http://nginx.org/) on the webserver. Then you can check from which base URL the user is coming from, and return the appropriate content. This is also possible with an Apache server using Virtual Domain Names.
Or you can setup your DNS correctly, this can be done by your domain provider.
I'm having a strange problem here and can't figure the cause. I have a php-script on an nginx server which triggers a redirect to a different (sub)domain on the same server:
For instance:
foo.domain.com/redirect.php
header("Status:301");
header("location:http://www.domain.com/new_url/");
The result is that I'm getting redirected to:
foo.domain.com/new_url
The domain doesn't change at all although my response headers look fine .
Any ideas?
Ok, I finally found the cause for my troubles. Neither Nginx, nor PHP caused the issues. My webservers are behind a loadbalancer running with Pound.
Pound has a feature to rewrite domains inside header redirects (enabled by default). We now turned this feature off and all redirects finally work as expected!
Check your containing your site in an iframe,
Some hosts can do this if its free hosting, all so some domains setup allows the site to be contained in an iframe witch would cause the properly your describing
I've got a number of subdomains on one of my sites. When someone goes to a subdomain that doesn't exist, I want to redirect to a 404 page on my main domain.
noexist.example.com --> example.com/404.php?subdomain=noexist (or without the query string if HTTP_REFERRER can give me that info)
I'm running LAMP on a VPS with cPanel installed. I can edit the DNS Zone file for the domain via WHM.
After a few hours ticketing my server's support center, I finally got wildcard subdomains set up.
Now when a user goes to subdomain.example.com, if that subdomain was explicitly set up via cPanel, it will function appropriately. If that subdomain was not explicitly set up then it will be interally redirected to example.com, where I can grab the subdomain that they used and handle it as necessary (show a page, redirect to a subdomain, or show a 404 error).
There are a ton of tutorials on how to create a custom 404 page, no need to redirect as apache should take care of this for you.
http://www.webmonkey.com/2010/02/create_custom_404_pages/
http://www.thesitewizard.com/archive/custom404.shtml
http://www.yourhtmlsource.com/sitemanagement/custom404error.html