IIS 7.5 - URL Rewrite - iis-7.5

How do I implement a simple rewrite to ensure that https://www.domain.com/whatever is always redirected to https://subdomain.domain.com/whatever?
Thanks

This feature is ccalled canonical domain.
There's a good reference in here:
http://thatsit.com.au/seo/tutorials/how-to-fix-canonical-domain-name-issues
Basically you add a new rule that sets a canonical domain and you enter that subdomain as the canonical domain.

Related

How redirect from subdomain to other domains URI?

Is there any DNS or .htaccess (or combination of a two) solution for this type of redirection:
blog.mydomain.com point to medium.com/my-publication
And yes I am trying to apply this specifically to medium.com publication so if SSL certification or any other environmental conditions are relevant you check how it handles it. I have full control of my domain on the other side.
I am looking preferably into DNS solution because I will not be able to test .htaccess for a while.
Well, as far as I know the only relevant DNS record would be a CNAME record, and it would only allow redirecting the entire subdomain to medium.com.
NAME TYPE VALUE
-------------------------------------------
blog.mydomain.com. CNAME medium.com.
To redirect to a specific URL, .htaccess would be needed, or a webserver that returns a redirect. If it were me, I'd setup a redirect for that specific article:
blog.mydomain.com/my-publication => medium.com/my-publication
But this requires a webserver being setup at blog.mydomain.com.

Rewrite rule in IIS for mutiple domain

trying to redirect a www domain to a non www i found the following article which work great for a single domain (http://egeek.dk/redirect-www-to-non-www-iis/) but my main problem is I am using orchard and want to do this for multiple tenant/domian name. basically I want any domain that is pointing to the server that has a www. to foward to http://domiananame.extension
We have a little module that does this so I have never tried using this module but you could try it out, may do what you are looking for...
https://gallery.orchardproject.net/List/Modules/Orchard.Module.CloudConstruct.BrowserDetection

Redirect domain to new domain using htaccess

I've looked around and around and couldn't find anything that worked specific to my needs.
I need to figure out how to mass redirect all URLs with the old domain to the new domain. For example:
http://www.olddomain.com/blog-post-title
to
http://www.newdomain.com/blog-post-title
The URI is always the same I just need the htaccess to recognize when a URL has this and redirect it to the new domain.
Any ideas?
Thank you!
If you want to redirect your old domain wholesale to the new one, you can just use the Redirect directive
Redirect / http://www.newdomain.com/

Where should a canonical domain name be enforced?

Our client would like to use just one domain name for their site to prevent diluting page rank in search engines.
For example, stackoverflow.com is the domain name they always use. If you type in www.stackoverflow.com you get redirected to the non-www version, as this is their choice for their domain name.
Where should this be done?
At the application server level (ex in IIS, set up a site and have it issue a permanent redirect to the proper domain name
At the application level
I don't like #1 as it means I have a bunch of extra sites set up just for redirecting. I don't like #2 as rewrite rules do affect performance.
thanks.
Do it at as low a level as you can possibly do it. Your application shouldn't know about its root domain name.

IIS URL Rewriting for all Inbound URLs?

Hopefully a simple question although one I have found impossible to answer myself using the Googles!
I have a website on IIS with the URL http://www.contoso.com/ which points to C:\www\public\
There has been a forced directory restructure so now all of the data (Default.aspx, Product.aspx, etc.) that originally resided in C:\www\public\ now resides in C:\www\public\en\ie\ - however, the IIS website document root is still C:\www\public\
So, essentially, I have a lot of inbound links to http://www.contoso.com/Product.aspx?id=1 (etc.) which are now returning 404 errors - the correct link is now http://www.contoso.com/en/ie/Product.aspx?id=1
Please consider that I can make no changes to the directory structure or the IIS document root... so I must solve this issue using URL rewriting.
Is it possible to capture all requests to contoso.com/* and rewrite them to contoso.com/en/ie/* ??
As Ivo suggests, using url rewriting you can set up inbound rules that match the old url pattern and redirect to the new pattern
http://learn.iis.net/page.aspx/460/using-url-rewrite-module/
Change the root directory of your website from C:\www\public\ to C:\www\public\en\ie\ and everything should be fine.
If you cannot do this for any reason, make a custom 404 page and rewrite to url in there and redirect with a 301
See: http://searchengineland.com/url-rewriting-custom-error-pages-in-aspnet-20-12234

Resources