Denna delen av 99 uppdateras inte längre utan har arkiverats inför framtiden som ett museum.
Här kan du läsa mer om varför.
Mac-nyheter hittar du på Macradion.com och forumet hittar du via Applebubblan.

301 redirect på ASP.net?

Tråden skapades och har fått 1 svar. Det senaste inlägget skrevs .
1
  • Medlem
  • Strängnäs
  • 2007-06-15 14:52

Hej!

Vi håller på att byta publiceringsplattform samt webhotell så alla länkar som google har hittat hos oss har bytt namn. På en apache-server kan man väl lägga en .htaccess-fiil i roten för att hjälpa sökmotorn att hitta vart varje sida heter nu. Men hur gör man något liknande på asp.net? Det jag har hittat info om är hur man kan lägga en 301 permanent redirect på varje "gammal" sida (asp.net c#):
Response.Status = "301 Moved Permanently"; Response.AddHeader("Location","http://www.new-url.com");

Men det här är inte så funkis för mig eftersom efter flytten så kommer bara det nya att synas.

Hur gör jag? Går det överhuvudtaget?

  • Go into the IIS site properties for the domain you're moving from. In the "Home Directory" tab, click the option "A redirection to a URL".

  • In the Redirect to box, enter the domain you wish to move to (no trailing slash), plus $S$Q - for example, http://www.99.se$S$Q

  • Next, check the options that state the client will be sent to "The exact URL entered above", and "A permanent redirection for this resource"

And that's it! Now, what does this $S$Q do? These are basically tags that IIS will automatically replace - $S will be replaced with the subdirectory location (such as /images/show.aspx) and $Q will be replaced with the querystring (such as ?id=30).

http://technet2.microsoft.com/windowsserver/en/technologies/featured/iis/default.mspx

1
Bevaka tråden