Running an existing Contao 4 Website on localhost - contao

I took over an existing contao project and pulled the files from the server for local development. The issue however is, that the page is automatically redirected to https and I can not find where to configure this.
In the web folder I'm running this command: php -S localhost:8190
and if I open the link, I get unexpectedly redirected to https://localhost/
Anybody knows how to keep the actual localhost url?

For the front end, this is configured in the respective website root's setting. So log into the back end (no automatic redirect to https should happen there, at least not by Contao itself), edit the settings of the website root and set the protocol to http (or disable https, depending on the Contao version). See also the Contao manual.

Related

Why would a website only load with Safari (DNS timeout otherwise)?

I am working on a web app on http://pagesage.page and have deployed with Digital Ocean on a Docker container with gunicorn and meinheld with A and AAAA name records set up. Additionally, the appropriate ports for http have been set up for listening and responding.
Unfortunately, while the page responds to curl, ping, and ping6 requests, the page only ever loads on the Safari browser (and some IE distributions) and I can't seem to figure out why (I get DNS timeout errors whenever I try to load the page in Chrome or Firefox).
I've tried accessing the page from different machines (brand new and old), reset the DNS settings a few times, and reset the browser's cache, all with no success.
Does anyone have ideas or suggestions, or has anyone else encountered this same problem?
You have a problem with your SSL/TLS terminaison. The website is available on HTTP but unavailable on HTTPS. Chrome and FF redirect the user to the HTTPS version. It looks like the port 443 (used for HTTPS) is closed.

www.sample.com automatically redirected to sample.com

I'm running two sites on Linode. Testing server.
I have one Wordpress site running on sample.com
I have another Ghost site that I want to run on www.sample.com
Note: the first one doesn't have www prefix
However when I try to access www.sample.com my browser instantly shows my Wordpress site at sample.com ( the one without www )
I can not narrow down where this setting is being enforced at.
I figure it either has to be in the Linode DNS settings -OR- in the nginx server settings. I can't find anything indicating that there should be a redirect of any kind.
Ammendment: On the nginx side, there is are two configuration files. The default server config file is pointing to the Wordpress installation which is loading for both www and non-www cases.
Ammendment: The remaining 1 configuration file is pointing to the Ghost installation.
Ammendment: When using the same two configuration files, but only changing the hostname to be "mail." instead of "www." the ghost installation loads just fine. The "mail." host was already registered in the dns settings, so I just borrowed it as a test.
What am I not consdering?
I'm not quite sure what happened. But, 24 hours later, the problem went away. Somewhere in the pipeline, old host/ip/port sets were getting cached and I couldn't resolve where. But, now it's working fine.
Thanks Richard Smith for taking time to talk me through it.

Any hits to localhost redirect me to IIS welcome page

I'm trying to debug my application but any URLs which contain localhost (I've tried IIS Express, Local IIS, a simple Node server, and a Python development server) are redirected to the IIS welcome screen.
Examples:
localhost:xxxx/MyController
localhost:xxxx/SomeFolder/SomeFile.html
localhost/MyApp/MyController
localhost/MyApp/SomeFolder/SomeFile.html
The URL changes from the full url to my external IP address (i.e., URL changes from localhost:xxxx/MyController to simply XX.XX.XX.XX)
I just tried launching with a brand new ASP.NET "Empty Web Site," just loading the index.html file, and same situation.
There are no entries in my hosts file and it appears that this is only happening in Chrome. Any ideas?
This works in php, so it may help you with ASP:
Run Notepad as administrator
Open C:\Windows\System32\drivers\etc\hosts file
add the following line to hosts file
127.0.0.1:123 yourserver.com
Save
Run command prompt using CMD in run or type it in start menu
Type this command and hit enter
ipconfig /flushdns
Close
go to yourserver.com
I hope this help you. Again, this works fine with PHP.
It sounds like your DNS is resolving the localhost hostname. If you're using your ISP's DNS, this may happen. You could change the DNS to Google's Public DNS. By pointing the DNS server to IP's 8.8.8.8 and 8.8.4.4. See the link for details on how to configure your computer.

Rails app tries to redirect to https

I'm deploying my existing https rails app to a staging server, and for some reason I keep getting redirected to the https version of the site (which is the desired behavior on the production server, but not on the staging on to which I'm deploying). On the staging server it doesn't return anything after getting redirected to https.
When I type in my.ip.add.ress in the browser, it redirects to https://my.ip.add.ress. I've checked that config.force_ssl = false. There does not appear to be any other function in my app that would redirect to ssl (searched for all occurrences of ssl and https in my app). rails c production boots up fine.
I'm not even sure my app is getting hit, as my production.log isn't being written to. Could apache be trying to redirect to ssl? There are no such directives in the apache2.conf (https://wiki.apache.org/httpd/RewriteHTTPToHTTPS).
I'm running Apache2 with the Passenger module. I don't have a .htaccess file in my app. It's a Rails 3.2 app.
Did you have "force_ssl = true" at one point? That would create a permanent redirect. Clearing your cache will fix that.
Or perhaps you've set the "Strict-Transport-Security" header on that domain? That would also force a redirect to the HTTPS version. To turn that off in chrome, navigate to "chrome://net-internals/#hsts". Then delete that domain. You can query it first, to see if exists in the cache.

Problem Publishing Silverlight Application LocalHost

I am trying to publish my SilverLight application to the web and I keep getting "An error occurred while trying to make a request to URI "http://localhost:2898....".
I've changed the ServiceReferences.ClientConfig to point to the web address but the app still keeps on trying to connect to localhost.
I've opened the application in FireFox and took a look at the firebug log and it says: -
clientaccesspolicy.xml 404 Not Found localhost:2898
crossdomain.xml 404 Not Found localhost:2898.
The silverlight app is accessing the web service in the same domain, I just don't know why it is still trying to connect to localhost.
Any help appreciated.
Steve
Two things come to mind, but check your "c:\windows\system32\drivers\etc\hosts" file and make sure ure local computer name or ip isnt mapped to localhost or the network machine isnt mapped to localhost for whatever strange reason.
Is the Silverlight app And WCF Service hosted on your localmachine, or are you accessing a server on your local network?
Just open the hosts file (C:\windows\system32\drivers\etc) and uncomment the following line (remove # from the beginning of the line): 127.0.0.1 localhost
Then save it, it should work.

Resources