Typo3: How to handle multi-domain in a development environment - typo3-8.x

I have a website with multiple domains (each domain has its own tree). On the live server everything is fine, but when I develop on localhost I have a problem:
I cannot (pre)view any pages from the other domain leafs.
Website1
www.domain1.com
localhost
Website2
www.domain2.com
The above domain records allow me to view all pages of Website1 - but when I want to see a page from Website2, I am redirected to www.domain2.com
e.g. //localhost/?id=100 redirects to //www.domain2.com/?id=100 which results in a 404 of course, because the page is not part of Website1 tree.
I am not able to enter localhost as a domain record for BOTH website roots.
Of course I could install virtual hosts on my local server, but this seems not convenient - I hope there is better solution.
EDIT:
When I add the language id to my URL, it works:
//localhost/?id=100&L=0
:-o

Localhost says to me: you have a local copy of the Website.
If so: disable all domain records, add
config.baseURL >
config.absPrefix >
To your root settings. I guess one or both of them are set.
Christian

Related

Issue with hosting subsite in IIS 10

Query regarding the configuration of website in IIS (Version-10.0.1741), we have configured a mainsite with name - Mainsite and subsite with name - Subsite. Both these sites have been mapped to two different physical paths with different content in index.html files only. Inside the server, basic settings of the mainsite is mapped to localhost and port 80. But when we try to browse the subsite http://localhost/Subsite/ it is always rendering the content of the mainsite and not the content of the subsite.
But we have tried everything in another server IIS, the same configuration is working fine. Mainsite and subsite content are loading fine.
Can someone suggest any part which must be checked or configured in our IIS for this issue. Thanks in advance.
Note:
We have tried adding virtual directory and converting that to website, but still it is not working
Also we have checked the permissions of the directory we have permissions to the physical path as well
We have tried URL rewrite from subsite to another mainsite called secondsubsite as well but then it is not working
We have checked the IIS event viewer logs and also checked the logs under IIS logging section still we haven't got any error logs

can't get my web site, on IIS, to work with URL beginning with www

I added my vb.net web app to IIS 8 on my Azure Windows 2012 server R2 VM.
Then, I did IIS > right-click Sites > Add Web Site
and set "Site name" to my_site.org
and set Physical path to project directory for my web site
and set "Host name" also to my_site.org.
Works great. From Internet, I browse to http://my_site.org and it runs OK.
Now I want people to also browse to www.my_site.org
but when I Add Web Site, just like above, but for www.my_site.org
it adds ok, but when I select www.my_site.org and click IIS Browse www.my_site.org browser pops up but reads "webpage cannot be found"
Nor can I browse it from Internet.
Because what is WWW? essentially that is a subdomain that you would need WWW to exist for it to load WWW.
Best option may be to set up domain forwarding to WWW, maybe a CNAME in your domain options?
From Azure documentation, "You must also provide the domain or subdomain alias for the CNAME, such as www if you want to create an alias for www.customdomain.com. If you want to create an alias for the root domain, it may be listed as the '#' symbol in your registrar's DNS tools."
More at:
https://azure.microsoft.com/en-us/documentation/articles/cloud-services-custom-domain-name/
Hope this helps! :)
Shahed

simulating a domain name with hostfile doesn't work as expected on IIS website

I have added a domain name in hostfile
127.0.0.1 mydomain.com
I created a website under IIS7 binding to mydomain.com and created a blank index.html in the website folder for test
But when I type in browser http://mydomain.com it shows the file for IIS default website. Instead I have to type http://mydomain.com/index.html to get the right page.
Same result for index.aspx file
Why ? What should I do ?
The correct answer was to replace 127.0.0.1 with actual IP of the server.

Bindings in IIS7 when creating a subdomain

I have a domain www.foo.com purchase with NameCheap.
I pointed that domain name to my VPS's static IP address and created a web application in IIS7 and it's working correctly.
Now I created another separate web application and set it's binding to forums.foo.com.
However the browsers doesn't enter the site and it seems the binding isn't doing quite what I expect it to do.
In Firefox, I get:
Server not found
Firefox can't find the server at forums.foo.com.
Is there some sort of special configuration I have to do in order for the subdomain to correctly point to my folder in inetpub?
Don't you have to configure the subdomain with namecheap first?
Who is serving dns for the subdomain?

Local testing for sub-domains using Url rewriter, Asp.Net 2

I am using UrlRewriting.Net for url rewriting in Asp.Net 2 and IIS 5.1 (offline) and IIS 6 (online)
The application performs the following:
A url of the following nature: http://username.site.com is re-written as
http://site.com/Default.aspx?user=username
This works perfectly online. However, I would like to know how we could test this offline.
I have tried pointing the application to 127.0.0.1 via IIS and then putting username.site.com in the hosts file to point to 127.0.0.1 - but it does not work out.
The website loads up - but the querystring is not generated.
Also tried putting just site.com -> 127.0.0.1 in the hosts file and accessing username.site.com. But in this case, the website does not load (site not found)
Any ideas?
easy way to test this will be to edit your hosts file so that username.site.com points to 127.0.0.1, but you will have to do this for each user you want to test on each PC...
Okay.
I managed to get this working. Its simple if you think about it.
I got myself a DNS server, installed it on my system and configured it to serve me pages from 127.0.0.1 for site.com
If you are wondering, I used a DNS server called SimpleDNS from http://www.simpledns.com/
There is also a free BIND DNS server available from:
http://oldwww.isc.org/sw/bind/view/?release=9.6.1b1&noframes=1
But that was too much for me to configure at this point of time.

Resources