How can I redirect the url to the corresponding page?

How to redirect a url like:

http://www.mysite.com/Join

to the corresponding page:

http://www.mysite.com/JoinOptions/MemberRegistration.aspx

Is there any way to do this?

I am using DNN CMS, but if you are unfamiliar with DNN and still have a redirect solution, that would be helpful.

Thanks
Matt

+3
source share
6 answers

DNN " URL". " " " URL" " ". , .*/Join/Default.aspx ~/JoinOptions/MemberRegistration.aspx ( , URL- , , URL- ~/Default.aspx?tabid=423).

, , IIS ASP.NET . - "Join" Default.aspx.

+4

- DNN SnowCovered, : http://www.snowcovered.com/Snowcovered2/Default.aspx?tabid=242&PackageID=7262

$15, , - .

/Join /JoinOptions/MemberRegistration.aspx

+1

Apache, .htaccess, :

RewriteEngine on
redirect 301 /Join http://www.mysite.com/JoinOptions/MemberRegistration.aspx

(, http://www.mysite.com/) Apache . Htaccess files mod_rewrite .

: . .

0

, IIS , .

  • JOIN
  • default.aspx
  • Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    
        Dim DomainName As String = Null.NullString
            Dim ServerPath As String
            Dim URL() As String
            Dim intURL As Integer
    
            ' parse the Request URL into a Domain Name token 
            URL = Split(Request.Url.ToString(), "/")
            For intURL = 2 To URL.GetUpperBound(0)
                Select Case URL(intURL).ToLower
                    Case "admin", "desktopmodules", "mobilemodules", "premiummodules"
                        Exit For
                    Case Else
                        ' check if filename
                        If InStr(1, URL(intURL), ".aspx") = 0 Then
                            DomainName = DomainName & IIf(DomainName <> "", "/", "") & URL(intURL)
                        Else
                            Exit For
                        End If
                End Select
            Next intURL
    
            ' format the Request.ApplicationPath
            ServerPath = Request.ApplicationPath
            If Mid(ServerPath, Len(ServerPath), 1) <> "/" Then
                ServerPath = ServerPath & "/"
            End If
    
            DomainName = ServerPath & "JoinOptions/MemberRegistration.aspx"
    
            Response.Redirect(DomainName,True)
    
    End Sub
    

, ,

: , amersan amp

0

IIS, ISAPI_Rewrite3..htaccess :

RewriteBase /
RewriteRule ^Join/?$ JoinOptions/MemberRegistration.aspx [NC,R=301,L]
0

. , , .

IIS

URL- (, http://yoursite.com/Join)

  • - → →
  • Home directory →
  • → → "insert"
  • aspnet_isapi.dll(. ) →
  • " ".
  • ok ok ok ok → IIS

DNN "Join"

/ Join, , , 301 URL ( )

* - C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll

0

Source: https://habr.com/ru/post/1731103/


All Articles