Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 Creating Rewrite Rules for the URL Rewrite Module
 New Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

top
Junior Member

150 Posts

Posted - 08 April 2015 :  18:28:50  Show Profile  Reply with Quote
Creating Rewrite Rules for the URL Rewrite Module


I'm trying to get URL rewriting to work under IIS 7 at GoDaddy

I tried adding a web.config
As is next

/forum/topic.asp?TOPIC_ID=number&HaberBaslik=test-test-test-test

What are the settings configuration file Code to Script



Edited by - top on 08 April 2015 18:29:05

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 09 April 2015 :  02:48:08  Show Profile
You would use something like this:


If Request("HaberBaslik") > "" Then
	Response.Redirect Request("HaberBaslik") & "=" & Topic_Subject
End If

Edited by - Carefree on 09 April 2015 19:28:17
Go to Top of Page

top
Junior Member

150 Posts

Posted - 09 April 2015 :  15:56:54  Show Profile
Thank you
Where is the code status
Is it a page or another config file
Is the link will be displayed in the browser like this
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=70920&HaberBaslik=Creating-Rewrite-Rules-for-the-URL-Rewrite-Module

I hope that explains it
http://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module

Edited by - top on 09 April 2015 19:25:08
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 09 April 2015 :  19:33:28  Show Profile
You will need to do something like this:


If Request("HaberBaslik") > "" Then
	If Topic_Subject = "" Then
		strSql = "SELECT TOPIC_ID, TOPIC_SUBJECT FROM " & strTablePrefix & "TOPICS WHERE TOPIC_ID=" & Request("HaberBaslik")
		Set rsHB = my_Conn.Execute(strSql)
		If Not rsHB.EOF Then
			Topic_Subject = rsHB("TOPIC_SUBJECT")
			rsHB.Close
		End If
		Set rsHB = Nothing
	End If
	Response.Redirect Request("HaberBaslik") & "=" & Topic_Subject
End If

Edited by - Carefree on 09 April 2015 19:35:11
Go to Top of Page

top
Junior Member

150 Posts

Posted - 09 April 2015 :  20:02:19  Show Profile
What is the page that is modified code
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 10 April 2015 :  04:56:04  Show Profile
That will work wherever you want it in the forum. If you place that in "topic.asp", it will use the TOPIC_ID of the topic you are looking at. If you place it anywhere else, you will have to provide the TOPIC_ID in Request("HaberBaslik").
Go to Top of Page

top
Junior Member

150 Posts

Posted - 10 April 2015 :  17:17:51  Show Profile
Has been no change in the URL
url="topic.asp?TOPIC_ID={R:1}"
would like to include the product name in the url. Can I do something like: http://forum.snitz.com/forum/topic.asp?TOPIC_ID=70920&HaberBaslik=Creating-Rewrite-Rules-for-the-URL-Rewrite-Module

Is that going to work? Any suggestions? Thanks a lot!!!
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 10 April 2015 :  17:51:34  Show Profile
Topic IDs cannot have letters or symbols, they are strictly numeric. Where did you get "{R:1}"?
Go to Top of Page

top
Junior Member

150 Posts

Posted - 10 April 2015 :  18:53:29  Show Profile
Change all links forums Title next link
Appears in the browser

We will create a simple rewrite rule that will rewrite URLs using the following format:
Of the
http://localhost/article.aspx?id=342
to:
http://localhost/article.aspx?id=342&title=some-article-title.

Thread way link here, but I want a copy of the application of the explanation Forum
Click here
http://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module


Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 11 April 2015 :  12:24:23  Show Profile
If you just want "topic.asp" to redirect, then that is what you will need to edit.

"topic.asp"

Look for the following lines (appx 160-166):

if recTopicCount = "" then
	if ArchiveView <> "true" then
		Response.Redirect("topic.asp?ARCHIVE=true&" & ChkString(Request.QueryString,"sqlstring"))
	else
		Response.Redirect("default.asp")
	end if
end if

Above those, insert these:


If (InStr(Request.ServerVariables("URL"), "topic.asp") > 0) Then
	strPathway = Request.ServerVariables("URL") & "?" & Request.ServerVariables("Query_String")
	If Request("TOPIC_ID") > 0 Then
		If Topic_Subject = "" Then
			strSql = "SELECT TOPIC_ID, TOPIC_SUBJECT FROM " & strTablePrefix & "TOPICS WHERE TOPIC_ID=" & Request("TOPIC_ID")
			Set rsHB = my_Conn.Execute(strSql)
			If Not rsHB.EOF Then
			Topic_Subject = rsHB("TOPIC_SUBJECT")
				rsHB.Close
			End If
			Set rsHB = Nothing
		End If
	End If
	strPathway = strPathway & "&Subject=" & Topic_Subject
	If Request("Subject") = "" Then	Response.Redirect strPathway
End If

Go to Top of Page

top
Junior Member

150 Posts

Posted - 11 April 2015 :  18:39:51  Show Profile
You are very good
Now working
I want to show within the forum / forum.asp
When the mouse passes on any link
And also a forum / default.asp
Forum Forum Sub when the mouse passes to section
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 11 April 2015 :  19:20:06  Show Profile
"default.asp" does not display any topic titles or topic ID numbers.

"forum.asp"


Look for the following line (appx 534):

Response.Write "<span class=""spnMessageText""><a href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & """>" & ChkString(Topic_Subject,"title") & "</a></span> </font>" & vbNewLine

Change it to say:


Response.Write "<span class=""spnMessageText""><a title=" & Replace(Topic_Subject," ", Chr(160)) & " href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & "&title="& Replace(Topic_Subject," ", Chr(160)) & """>" & ChkString(Topic_Subject,"title") & "</a></span> </font>" & vbNewLine


Edited by - Carefree on 12 April 2015 15:23:30
Go to Top of Page

top
Junior Member

150 Posts

Posted - 12 April 2015 :  12:01:38  Show Profile
error

quote:

In the hope of amendment includes code - instead of %20 Between words

"forum.asp"


:


Microsoft VBScript compilation error '800a0401'

Expected end of statement

/forum/forum.asp, line 625

Response.Write "<span class=""spnMessageText""><a title=" & Replace(Topic_Subject," ", Chr(160)) & " href=""topic.asp?" & ArchiveLink & "TOPIC_ID=" & Topic_ID & "="title="& Replace(Topic_Subject," ", Chr(160)) & """>" & ChkString(Topic_Subject,"title") & "</a></span> </font>" & vbNewLine
--------------------------------------------------------------------------------------------------------------------------------------------------------------------^





Edited by - top on 12 April 2015 12:40:53
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 12 April 2015 :  15:24:11  Show Profile
See the correction above.
Go to Top of Page

top
Junior Member

150 Posts

Posted - 12 April 2015 :  17:49:23  Show Profile
Thank you working now
Carefree You are truly a source of pride

Edited by - top on 12 April 2015 17:49:52
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 12 April 2015 :  18:38:23  Show Profile
You're welcome.
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.38 seconds. Powered By: Snitz Forums 2000 Version 3.4.07