Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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.5asp.net Version: 4.0.30319
Thanks in advance.
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.
Layout = null;
var redirectUrl = Model.Content.GetPropertyValue<string>("redirectUrl");
Response.StatusCode = 301;
Response.StatusDescription = "Moved Permanently";
Response.RedirectLocation = redirectUrl;
Since .NET 4.0 you can just shorten all that code to:
See http://msdn.microsoft.com/en-us/library/system.web.httpresponse.redirectpermanent ;
Response.RedirectPermanent() statusCode is 301.
if I need Redirect with statusCode = 302?
You can just use Response.Redirect() which is a 302.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted