moodle gets into 'endless redirection' when configured as subdomain - apache

I'd like to setup my moodle instance to be available by address: http://mymoodle.mysite.com.
mysite.com is already registered and I can easily access it because I've configured it at my hosting provider to refer to the IP (let's say IP address x.x.x.x) of my server where I store my web page.
To register the subdomain I'm specifying another IP address where my moodle instance is installed (e.g. y.y.y.y) and configure my provider to do permanent redirect to the URL http://y.y.y.y
moodle instance is installed at wwwroot folder of the web sever, it's accessible via http://y.y.y.y
Now it works for me in the following way: I type http://mymoodle.mysite.com in address bar of my browser and it redirects me to my moodle instance, I see a main screen, all works fine but the URL in address bar is changed to http://y.y.y.y
Alhtough I'd like to see my fancy subdomain address but not IP.
My config.php originally looks like that
$CFG->wwwroot = 'http://y.y.y.y';
but if I change it to
$CFG->wwwroot = 'http://mymoodle.mysite.com';
I'm getting into 'endless redirects'.
Is there a way to resolve this issue and get rid of IP address in address bar?

If you have changed the url of Moodle after the set-up you have to follow those steps : https://docs.moodle.org/310/en/Moodle_migration. Only updating $CFG->wwwroot will not be ok.

Related

Vue.js app hosted on githubpages not working with custom domain

So i have a Vue.Js bassed app, on localhost it works great. When i host it on github-pages without custom domain it works aswell, but when i change custom domain it shows 404 error :
I've checked dns via https://dnschecker.org both A Records and CNAME gets resolved.
Github pages also resolves my dns:
As mentioned in this so i've created a 404.html file in public folder.
Repo link : Github
Domain : https://www.amberkrynica.pl
It seems that not all DNS servers can resolve your nameservers. https://dnschecker.org/#NS/www.amberpokoje.pl
My guess is that this may be a problem with your registrars DNS changes not getting picked up by big DNS providers.
If the domain is new, the new nameservers may take some time to pop-up everywhere.
If it's not a new domain, try to contact your provider to check with them if everything is working.

app.UseHttpsRedirection() is redirecting to "underlying" hostname not "request" hostname

Background
I have an Azure App Service hosted at myazurewebsite.azurewebsites.net.
The Azure App Service Startup class contains the line app.UseHttpsRedirection().
If I type http://myazurewebsite.azurewebsites.net into a browser, it redirects to https://myazurewebsite.azurewebsites.net - great!
I have DNS CNAME mydns.mycoolserver.com which references the above App Service.
If I type https://mydns.mycoolserver.com into a browser, then the browser shows my app service, and the address bar of the browser shows https://mydns.mycoolserver.com and all is good.
Problem
If I type http://mydns.mycoolserver.com into a browser, then the address bar of the browser shows https://myazurewebsite.azurewebsites.net.
So, it seems to me that the UseHttpsRedirection middleware has worked, but that it is redirecting to the "underlying" hostname, not the "original" hostname.
Note: in reality there is a Standard Akamai CDN in between myazurewebsite and mydns, so mydns is pointing to the CDN endpoint (myazurewebsite.azureedge.net) not the actual app service. Standard Akamai CDN doesn't have a rules engine so it isn't capable of doing http->https redirect, so I assume that it is the app.UseHttpsRedirection that is doing the redirect.
Anyway, in the above scenario, how can I get http://mydns.mycoolserver.com to redirect to https://mydns.mycoolserver.com?

Steps to redirect Application URL to Custom URL

i have IHS 7 installed on an AIX system and its pointing to Application Server . now my requirement is if Application is not accessible or if we are working on the Application it self then whoever access the URL, it redirects to a custom page on the webserver that Application is under construction .
for example url is https://my.Application.com:8089/application if anyone hits this URL then this URL is redirected to custom URL on same webserver https://my.webserver
i have configured a proxy on IHS httpd.conf but it is not working
The good practice in such case is to create two config files and one maintenance page. When your app server do not work you should restart http server with config file which point to the maintenance page.

Different pages related to website ip address

My website is assigned a particular ip address.
Now, is there any way to configure web server like apache so that when I enter the website url in a browser, it shows a different page than when I enter the ip address related to the website?
Yes. What you're looking for is apache Virtual Hosts.
You'll also need to configure your domain to point to your ip.

Facebook apps on a domain with URL forwarding and masking

I'm developing a web application with Facebook Javascript SDK on my server at http://example.com/webapp/. Now I registered a new domain name, say domain.com, with no hosting, and I forwarded with URL masking domain.com to example.com/webapp/, so the web app is still on my server at example.com/webapp/. I've tried to change app settings on Facebook, site domain to domain.com and website URL to domain.com, but the Javascript SDK doesn't work!
I think that the problem is that requests to facebook comes from my server at example.com and the app domain is domain.com. I notice that the JS SDK uses window.location to retrieve the url to be matched with the app domain and website url.. Is there a way to inject the redirect_uri parameter on every JS SDK functions call with the url of my redirecting domain domain.com?
Thanks to all in advice!
Instead of using URL Masking / Forwarding, you should see if you can use your domain domain.com pointing straight to example.com/webapp using Add-on Domains.
I.e. create a virtual host and have the new domain link to the actual files on the old domain name. Fowarding isn't the best way as some forwards use iframes or javascript to redirect.