Before proceeding with the explanation it is good to do a backup of all your data so that no data is lost.
If you need to move your entire website into BlogEngine.net from a subdirectory to the root of your own site, all you have to do is remove all the content from the subdirectory with FileZilla Client and move it to the main root.
Then open the file Global.asax, located in the site root, and replace the lines of code below:
void Application_BeginRequest(object source, EventArgs e) { HttpApplication app = (HttpApplication)source; HttpContext context = app.Context; // Attempt to perform first request initialization FirstRequestInitialization.Initialize(context); }
with the following:
void Application_BeginRequest(object source, EventArgs e) { HttpApplication app = (HttpApplication)source; string thisUrl = app.Request.Url.ToString().ToLower(); if (thisUrl.Contains("https://www.SoulTricks.com/blogengine")) { HttpContext.Current.Response.Status = "301 Moved Permanently"; HttpContext.Current.Response.StatusCode = 301; HttpContext.Current.Response.AddHeader("Location",thisUrl.Replace("https://www.SoulTricks.com/blogengine","https://www.SoulTricks.com")); CompleteRequest(); } HttpContext context = app.Context; // Attempt to perform first request initialization FirstRequestInitialization.Initialize(context); }
This is the best way for users and search engines to be directed to the correct page. In this way, those who type the old URL https://www.SoulTricks.com/blogengine in the address bar will automatically be directed to the new URL https://www.SoulTricks.com.
Code 301 indicates that the page has been permanently moved to a new location.
I 301 redirects they are useful when:
- you moved the site to a new domain;
- users access your site through different URLs, for example: http://example.com/home, http://home.example.com or http://www.example.com. With the 301 redirect you define the preferred URL;
- you want to merge two websites and you want to make sure that the links to the previous URLs are redirected to the correct pages.
Alejandro Crespo Martinez
We are a specialized and passionate team of virtual reality. We have extensive experience in this area. We decided to create ForVirtualRealityLovers to share all our information with customers and users. We have quality information. You can find tips, guides, interviews, top products and much more! If you are curious, enter our site ForVirtualRealityLovers.com and discover the virtual world! 😉
BlogEngine.net: Disqus comment count generates an error that's why ❯
Articles related toBest alternatives to Stockists to buy smartphones and tabletsPrime Day 2020: best audio, photography and smart TV offersHow to make and save screenshots of Internet sitesHow to buy on Amazon without being scammedOnePlus X, Meizu Metal e Meizu Pro 5 in preordine su GearbestOnline shopping, food and drinks now arrive directly at home: here are the numbers of an announced successAdd a comment from BlogEngine.net: how to move a website from subdirectories to rootInternet
❤️Chi Sleep For Virtual Reality Lovers?For Virtual Reality Lovers we are a team of people who aim to give you all the best information about Virtual Reality. What information do we share?We share everything you need to know about virtual reality, tips, prices, features, guides and much more !. 🤖What are the best virtual reality products?We have the best information section on the best virtual reality products. This work is under a Creative Commons Attribution-Non-Commercial-No Derivatives 4.0 International License. 2021/primerpaso.me X Check out our best articles!How to find out who visits your Facebook profileHow to insert a donation button in Blogengine.netTrack Twitter clicks with FeedburnerHow to archive Outlook messages |