web.config for particular domain - web-config

I have two domain names: www.website.com and www.website.cc. Both domain names direct to the same IIS 7.5 website. My web.config has customErrors section. I want to set different customErrors urls for .com and .cc. Is it possible to create a subsection in web.config for .cc domain?

It's not possible to have different customErrors Elements in your web.config.
You probably might use the defaultRedirect Attribute to point to a generic Error Handling Page. From there you should be able to handle the different sites and redirect from there on...
You might also consider to use the different ASP.NET Events at Page (Page_Error) and Application level (Global.asax -> Application_Error).

Related

TYPO3 - Multi-Domain-Installation

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

Possible to create pages within subdomain using CNAME?

janedoe.com is a normal website, built in php and html with one exception. Because the website is for a realtor, she needed to have the ability to allow her clients to search the MLS for properties (called IDX).
In order to get the IDX Search to actually be on janedoe.com, we had to use a subdomain, properties.janedoe.com, and then create a CNAME, which points to their IDX search.
My problem is: properties.janedoe.com and others return a 404 because the IDX search doesn't use those pages.
Can I somehow, even though there is a CNAME record, create pages under the subdomain?
--If not is there some way, whether through .htaccess or otherwise, that I can do something like a 301 redirect so that if for some reason someone went to http://properties.janedoe.com/, they wouldn't be given this:
I'd also like to be able to install my sitemap generator to the subdomain as well if there's a way to access FTP despite the CNAME.
Thanks in advance

What do these terms mean in CQ5/AEM Environment?

What is the meaning of the below mentioned terms ? Are they any different from each other?
URL Redirect Rules
Resource resolver settings for URL shortening
Sling Mapping
Vanity URL
Vanity Domain
Update :: Re- constructed the question
As per my understanding the above terms mean the same thing. I have read the documentation but haven't clearly understood it.
Found an awesome link to my questions.
AEM URL Rewriting
The typical website structure for an Adobe CQ5/AEM project begins with /content in the URL structure and typically contains the application name. My example application’s homepage has the URL structure /content/cookbook/en/home.html which matches the JCR structure for the website. This is not an ideal url path most people would like for their site. To address this concern we will utilize two methods for rewriting URLS within AEM.
Sling Resource Resolver
Inside AEM you can configure the Sling Resource Resolver to filter out the initial path of your site structure. To achieve this you need to edit the Apache Sling Resource Resolver Factory inside the system console’s configuration section (/system/console/configMgr). You will need to add an entry under the URL Mapping property to remove the beginning portion of the URL you want remapped. In my case I have entered /content/cookbook/-/ so that /en/books.html now resolves the url /content/cookbook/en/books.html. This will apply to all sites within your site so you may want to review your site structure to avoid a conflict.
Vanity URLs
For some sites there might be a requirement to create a friendly url for navigating into your site. In my case I want to type http://localhost:4502/books to navigate to the /en/books.html page. In this scenario I may just decide to edit the Vanity URL property for the books.html page. I can specify that /books is the vanity url and any traffic to that URL will be redirected to books.html. This can be convenient for site with only a couple vanity URLs but isn’t idea since it can be edited by an author.
Sling Resource Mappings
If you wish to keep url mapping rules outside of the author’s control then you should utilize the Resource Mapping features in Sling. Under /etc/map/http you can create nodes of the jcr type sling:Mapping that will allow you to do the same thing as vanity urls. These nodes require two properties to be set: sling:match and sling:internalRedirect. The sling:match property uses regular expression to evaluate the url to match. If the url is matched then the request is redirected to the path set in the sling:internalRedirect property. In the example application, the matched path localhost.4502/authors is redirected to the /content/cookbook/en/authors.html page.
I'll give it a try:
URL Redirect Rules -> This sounds for me more like mod_rewrite in apache
ResourceResolver settings -> Can be configured in OSGi (Apache Sling Resource Resolver Factory). Usually the path to a page starts with /content/sitename/language. So the language maybe interesting for the visitor, but the first two are not, so you want to map /content/sitename/ to / so you can have call mydomain.com/language in the browser
Sling mapping is more or less the same logic as ResourceResolver, but you don't configure the ResourceResolver in OSGi, but have a mapping below /etc/map/http
VanityUrl -> This is more like an alias for a path mostly used for marketing URLS like mydomain.com/product1 which could point to /content/sitename/language/products/product1 It would not make sense to have a ResourceResolver or Sling mapping for each product
Vanity Domain is linked to VanityUrl so you can have the same VanityUrl for different domain: mydomain.com/product1 ponts to a different site than myseconddomain.com/product1

How do I redirect a domain to a specific "landing page"?

My client has several parked domains. She wants those domains to point to specific pages in her main site. For example:
Let's pretend she has a page on her main site about bedroom redecorating. That page is located at www.mainsite.com/bedrooms/
And let's say she has a parked domain called www.999bedrooms.com/
She wants to redirect that domain to www.mainsite.com/bedrooms/
What's the best way to do this without being penalized by the search engines?
Also, keep in mind that www.mainsite.com/bedrooms is actually a WordPress page, so it's not an actual file on the server, per se.
Thanks!
There are (at least) two ways to do this. One way requires access to some sort of configuration on the server, and the other doesn't. I don't know if you're using the Apache web server, but if you are, you would add mod_alias to your configuration and restart Apache:
a2enmod alias
apache2ctl graceful
Then add this to the VirtualHost section for 999bedrooms.com:
Redirect permanent / http://www.mainsite.com/bedrooms
Then you should be done.
The other way is in an HTML file that you put at http://999bedrooms.com/index.html, put a line like this within the HEAD section:
<meta http-equiv="refresh" content="1; url=http://www.mainsite.com/bedrooms">
This is one of those "Please wait while we redirect you to our main page" sorts of redirections that you see sometimes. Not as nice as the server-based ones, but easier to do.
Hope this helps!
Well there are a couple way. Most likely your web host supports the redirection for you using a 301 Redirect HTTP response. Check out your web host and see if they offer a directory redirection (I know that fastdomain which is my hosting provider does).
Alternatively, if you hosting provide supports PHP you can use the following and place it in a file called index.php in the top level of the domain you wish to redirect.
<?php
header("Location: http://www.mainsite.com/bedrooms/");
exit;
?>
Simply add this line to your header.php file:
<script language="JavaScript">document.location.href = "http://www.mainsite.com/bedrooms";</script>

MVC 2 Area Authentication Not Working

Using MVC 2, if I setup my root web.config with forms authentication (there is no locations section), and I go to a page outside an area (off of the root), I get redirected to the login page as one would expect. However, if I go to a page in an area, I don't get redirected as expected. Do I need an additional web.config somewhere in the area or do I possibly have something mis-configured?
Also, I have been sure to clear all cookies and start from a new session and browser just in case something was holding over from a previous login.
I really did not want to have to maintain locations or multiple web.config files since the whole site needs authentication.
If it helps, I am using Visual Studio 2010 and started with a MVC 2 template.
Warning: I have only had 2 cups of coffee this morning so it could be a short circuit between the chair and the keyboard...
Thanks,
--Patrick
Web.config authorization should not be used with an MVC application. Instead, apply the [Authorize] attribute to the controllers you wish to protect. If all of your controllers site-wide need authorization, consider having a BaseController with an [Authorize] attribute and having all of your controllers site-wide subclass the BaseController.