---
title: "response.write site pathen."
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/67047-response-write-site-pathen"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "mattiasnordin"
published: "2003-02-03T14:42:30.000Z"
updated: "2003-02-03T14:58:22.000Z"
replies: 2
views: 170
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/67047-response-write-site-pathen"
---

# response.write site pathen.

## #1 — mattiasnordin, 2003-02-03T14:42Z

Finns det något VB kommando som printar ut sitens domännamn?

Request.ServerVariables("SCRIPT_NAME") skiver ut rootpathen.

Jag vill få fram: 

"http://www.sitenamn.se" för att sedan lägga till Request.ServerVariables("SCRIPT_NAME").

Jag vet nämligen redan nu att hela siten kommer att byta namn och jag har tidigare hårdkodat in den informationen.

 :h

Permalänk: https://www.webforum.nu/p/67047

## #2 — Erik Juhlin, 2003-02-03T14:53Z

En funktion du skulle kunna använda. :)

```
Function GetPageURL()
	
	Dim sProtocol, sServerName, sScriptName, sQueryString
	
	If UCase(Request.ServerVariables("HTTPS")) = "ON" Then
		sProtocol = "https://"
	Else
		sProtocol = "http://"
	End If
	
	sServerName = Request.ServerVariables("SERVER_NAME")
	
	sScriptName = Request.ServerVariables("SCRIPT_NAME")
	
	sQueryString = Request.QueryString
	If Len(sQueryString) Then sQueryString = "?" & sQueryString
	
	GetPageURL = sProtocol & sServerName & sScriptName & sQueryString
	
End Function
```

Permalänk: https://www.webforum.nu/p/937007

## #3 — mattiasnordin, 2003-02-03T14:58Z

Tackar  :e

Permalänk: https://www.webforum.nu/p/937011

---

Tråden på webben: https://www.webforum.nu/amne/asp/67047-response-write-site-pathen
