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.
ThanksMatt
DNN " URL". " " " URL" " ". , .*/Join/Default.aspx ~/JoinOptions/MemberRegistration.aspx ( , URL- , , URL- ~/Default.aspx?tabid=423).
.*/Join/Default.aspx
~/JoinOptions/MemberRegistration.aspx
~/Default.aspx?tabid=423
, , IIS ASP.NET . - "Join" Default.aspx.
- DNN SnowCovered, : http://www.snowcovered.com/Snowcovered2/Default.aspx?tabid=242&PackageID=7262
$15, , - .
/Join /JoinOptions/MemberRegistration.aspx
/Join
/JoinOptions/MemberRegistration.aspx
Apache, .htaccess, :
RewriteEngine on redirect 301 /Join http://www.mysite.com/JoinOptions/MemberRegistration.aspx
(, http://www.mysite.com/) Apache . Htaccess files mod_rewrite .
: . .
, IIS , .
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
IIS, ISAPI_Rewrite3..htaccess :
RewriteBase / RewriteRule ^Join/?$ JoinOptions/MemberRegistration.aspx [NC,R=301,L]
. , , .
IIS
URL- (, http://yoursite.com/Join)
DNN "Join"
/ Join, , , 301 URL ( )
* - C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
Source: https://habr.com/ru/post/1731103/More articles:Can I use a different Eclipse formatting profile to open and save? - eclipseHow to remove Debug -> Attach to Process in Visual Studio 2008? - debuggingASP.NET Virtual Directory for General Labeling - asp.netFree version of nhibernate automap version - concurrencyNSTimer (s) cancellation and re-creation issues - objective-cHow to remove field from model in google engine using java? - javaКаковы преимущества и недостатки Passed Arrays vs Global Arrays в Excel VBA - vbaCancel textbox input on validation error in WPF - validationМастер установки для моего приложения в форме окна - или нет? - installChecking decimal numbers in a WPF text box - c #All Articles