I have been set a challenge. I need to make "domain.co.uk/thispage" redirect to "domain.co.uk/thispage/thispage.aspx" preferably transparently.
I have to add a page to the umbraco site that is outside umbraco and will only exist for a short period, but it needs to be on the same domain and look like part of the site. It will be stored on the same server, in the same site but outside umbraco.
what is the best way to achieve this? after a while of searching documenation and forums I have seen
Umbraco Version: umbraco v 4.7.2 (Assembly version: 1.0.4500.21031) IIS Version: 8.5 asp.net Version: 4.0.30319
You could create a new document type called 'Redirect Page' and add a property to it called 'Redirect Url'. Within the new template for the document type, you could perform a redirect to the 'Redirect Url' property value. Something like the following, with a 'Redirect Url' property value of the local page you want to redirect to.
redirect virtual page to external url
Hello,
I have been set a challenge. I need to make "domain.co.uk/thispage" redirect to "domain.co.uk/thispage/thispage.aspx" preferably transparently.
I have to add a page to the umbraco site that is outside umbraco and will only exist for a short period, but it needs to be on the same domain and look like part of the site. It will be stored on the same server, in the same site but outside umbraco.
what is the best way to achieve this? after a while of searching documenation and forums I have seen
Umbraco Version: umbraco v 4.7.2 (Assembly version: 1.0.4500.21031)
IIS Version: 8.5
asp.net Version: 4.0.30319
Thanks in advance.
Hi Alx,
You could create a new document type called 'Redirect Page' and add a property to it called 'Redirect Url'. Within the new template for the document type, you could perform a redirect to the 'Redirect Url' property value. Something like the following, with a 'Redirect Url' property value of the local page you want to redirect to.
Thanks, Dan.
Since .NET 4.0 you can just shorten all that code to:
See http://msdn.microsoft.com/en-us/library/system.web.httpresponse.redirectpermanent ;
hi Dan, Response.RedirectPermanent() statusCode is 301.
if I need Redirect with statusCode = 302?
You can just use Response.Redirect() which is a 302.
eg.
Response.Redirect("http://www.mysite.com/mypage.html");
is working on a reply...