TYPO3 - Multi-Domain-Installation - typo3

Does anybody have sophisticated knowledge about running a multi-domain-site using a single typo3-instance ?
E.g. I have 2 domains, both being served by the same webserver, using different vhosts. What I want to achieve, is both vhosts pointing to the same document root, where a typo3-instance is installed. This TYPO3-instance should check by typoscript, which domain was used in the request and forward requests for each domain to a specific subpage ("landing page for that domain").
I need this to work in a productional & stable environment, due to custom-self-developed extensions, which provide necessary data for both installations, also specific extbase-domain-models should be usable in both domains etc.
I am already able to check the requested domain via typoscript-conditions. What I am missing, is some info, about how I could possibly realize the redirection, without the client being redirected to the landing page each time while using sub-pages of the landing-page. Do I need to set cookies for this !?
Thanks in advance, Oliver

In TYPO3, you can combine several sites (each with a different domain) in one Installation. This already works out of the box.
So, for this requirement
This TYPO3-instance should check by typoscript, which domain was used in the request and forward requests for each domain to a specific subpage
it is not necessary to add a check for TypoScript, TYPO3 will automatically resolve the URLs.
Page Tree:
pid=0
| --> root page 1
| --> root page 2
On both root pages, enter page properties : "Behaviour" checkmark enable "Use as Root page"
On both root pages, create a TypoScript template, edit it, got to tab "Options", checkmark "Rootlevel". Have this TypoScript template include your general TypoScript configuration, e.g. via "static includes" (ideally you put your TypoScript configuration in an extension)
Since TYPO3 9: configure a site for each page tree under "Site Management > Sites". Before TYPO3 9: On both root pages create a "Domain" record

Related

TYPO3 No TypoScript template found - custom page

We're running TYPO3 9.5 with correctly set up Site Configuration. The main domain has multiple subdomains which have their own Site Configuration.
domain.com
sub1.domain.com
sub2.domain.com
sub3.domain.com
All these urls point to a different Site Configuration, which works fine. But when a user types sup1.domain.com instead of sub1.domain.com, "No TypoScript template found!" is shown. Within the Site Configuration "Error Handling", "Show content from page" is set up for error 503.
The configured error page is not showing, but the default "No TypoScript template found!". How could we show an actual TYPO3 page when a subdomain is entered wrong?
The 404 page works fine, but only with segments after the actual domain, eg. sub1.domain.com/does-not-exist shows the 404 page, as configured.
As already noted by Julian Hofman you should redirect all 'non-existend' subdomains to your main (sub) domain.
Sure, in this situation you cannot handle typos, but this solution is very fast and error-safe. TYPO3 can only handle "known" (sub)domains.
Redirecting all unknown subdomains can be done via .htaccess (on Apache) or your domain hosting admin-panel .
HTH Henrik

TYPO3 change the site url to Localhost after copying from live site

I am new in TYPO3, I copied a TYPO3 system to localhost so I can develop offline, no my problem is all the link points to the live site. my_live_cite.com
What should I change in the backend to redirect all links and ref to localhost ?
Check and adapt for sys_domain records (see root page PID=0).
See also TypoScript (TYPO3 backend modul Templates) and check/adapt the domain you are looking for to change. Select in TypoScript Template module TypoScript object browser where you can search in constants and setup (configuration) for strings.
Cause of TypoScript can bee different ways, to handle domains. Have a look at config.baseURL and maybe page.config.baseURL

Creating a redirect in IIS6

I need to create a redirect from www.domain.com/page to another page in a different domain. I need the first (referring) url to have no extension (meaning no .html or .asp).
I know how to do it in Apache, but have no clue how to work with iis6.
Is there any simple way of doing this?
Here is an easy solution:
Create a folder for your website www.domain.com and then another sub folder for "page".
Create a website in IIS manager for www.domain.com
Expand that website, and then right click on your "page" folder, choose properties.
On the directory tab, choose the option: A redirection to a URL put the full domain of the target location. You may also want to examine the check boxes below it if that fits your needs.
Another option that you could do outside of IIS is setup your website, and take advantage of the "default document". if you add an index.html file into your website at http://www.domain.com/page , the default document will be called automatically without referencing the index.html in your path and you can do a javascript redirect.
<script>
window.location='http://www.someothersite.com/page.html'
</script>
This may be easier when dealing with a large number of pages.

Multiple stores in Magento 1.7. Not directing to new website

Multiple stores in Magento 1.7.
I am having issues setting this up.
I have set up via configuration two websites, store, store views etc and the url's in web config.
I have changed the A records on the domain to point to the magento website and I have as instructed changed index.php but when i type in my 2nd website address it just takes me to the main (original) website pages, if I change the default website in Magento it works! I can't be far off but I'm struggling now, any advice?
I've been told that in 1.7 I only need to alter index.php to make it work
Andrew
you must provide either store code or website code to server variable $_SERVER['MAGE_RUN_CODE'] or as first parameter to Mage::run() function in index.php file, for example if every subdomain of site has one store, you can accomplish this by:
$storeOrWebsiteCode = strtok($_SERVER['HTTP_HOST'],'.');
$_SERVER['MAGE_RUN_CODE'] = $storeOrWebsiteCode;
or
$storeOrWebsiteCode = strtok($_SERVER['HTTP_HOST'],'.');
Mage::run($storeOrWebsiteCode, 'website');
or
Mage::run($storeOrWebsiteCode, 'store');

Where are subdomains ("shortcuts") defined in TYPO3?

On a corporate website managed with TYPO3 there are shortcuts defined which lead to a page on the site.
Example:
Corporate website is www.acompany.com
Then there is a site www.acompany.com/coolproduct which is redirecting the user to www.acompany.com/products/productgroup3/product25.htm for example.
Where in TYPO3 can such "shortcut" links be defined?
Most probably some page in the page tree has set type to: Shortcut which causes that it points some other page or resource, it's also possible that is set as Link to External URL and there is full URL given.
Check the page tree in the backend and find your coolproduct page in it. Then check the site's properties and change if required to other value/type.
It's also possible that this URL is generated by some plugin or TypoScript, but in this case you'll need to investigate it yourself.
Simplest way to find these kinds of things is actually using the search engine in the TYPO3 backend. You will find it in the upper right corner.
If this fails, what I do is install PhpMyAdmin from the extension repository. Once you have PhpMyAdmin you can use it's search functionality to find anything in the database using a search query of: '%coolproduct%' and selecting all tables. In the results look for the 'pid' field. It tells you on which page in TYPO3 the found item is located.
Does the page use the extension realURL? If so, there might be realURL redirects defined.
Have a look at page -> info -> RealUrl -> Redirects
Maybe you the user has defined this link redirection in many pages, you can search for it in the database exactly in the tt_content table.
You can set shortcut for your domain to any page of your site, so when user enter only your domain name in url then it redirects to page which you set in shortcut.
For that edit your domain and set shortcut to any page of your page tree.