Hi!
What is the most easy way to implement friendly URL:s? I code in VB and my server is Windows server 2003.
For example i have a car page that has id 5. My pages is now shown like this:
www.mysite.com/?id=5
But i want it too bee like this!
www.mysite.com/cars
My code looks like this now:
Thank youCode:Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack Then Dim pID As Integer If Request.QueryString("id") = "" Then pID = 1 Else pID = Request.QueryString("id") End If Dim oConn As MySqlConnection = DBConn.getConn("mydb") oConn.Open() Dim getSQL As String = "SELECT * FROM pages WHERE nID = '" & pID & "' AND deleted = '0'" Dim command As MySqlCommand = New MySqlCommand(getSQL, oConn) Dim r As MySqlDataReader r = command.ExecuteReader() Label1.Text &= "<table cellpadding='5' cellspacing='0'><tr><td>" While r.Read() Label1.Text &= r("nContent") End While Label1.Text &= "</td></tr></table>" r.Close() oConn.Close() oConn.Dispose() End If End Sub
/Patrik




Reply With Quote