Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Dotnetnuke Url Rewriter Dotnetnuke Url Rewriter
Previous
 
Next
New Post
4/24/2007 4:28 PM
 

how do we stop from users making a mistake and  mistakenly type in wrong category name? Ex/ http://www.dotnetnuke.com/Anyfoldername/tabid/799/Default.aspx returns a valid 200 header, which is wrong, it should return a valid 404 page. I need a way that dotnetnuke outputs one absolute url, which anyway changed in url shd be causing a 404 error.

 
New Post
4/25/2007 2:01 PM
 

I do not believe there is anything that can be done with the URL Rewriter to support this functionality.

I think the only options would be to turn off the url rewriter.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
4/26/2007 4:30 AM
 

Thanks,

i have found one link http://www.wwwcoder.com/main/parentid/263/site/2295/68/default.aspx

as per the article code

Option Strict On
Imports System.Data
Imports System.Configuration

Public Class _404Handler
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "
#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As _
                 System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        Try
            Dim strQuery As String = Request.ServerVariables("QUERY_STRING")
            If strQuery <> "" Then
                'Now we'll remove the stuff we don't need.
                strQuery = strQuery.Replace("404;http://", "")
                'Get rid of the domain name since we're dealing with multiple domains.
                Dim intSlashPosition As Integer = strQuery.IndexOf("/")
                strQuery = strQuery.Remove(0, intSlashPosition)
                ' now do a lookup in our table to find out if there is a related page.
                Dim NewURL As Integer = DoURLLookup(strQuery)
                If NewURL <> -1 Then
                    Response.Redirect("/DesktopDefault.aspx?TabID=" & NewURL.ToString)
                Else
                    'if we don't have any, just send them to the home page of the site.
                    Response.Redirect("/")
                End If
            Else
                Response.Redirect("/")
            End If
        Catch ex As Exception
            Response.Redirect("/")
        End Try
    End Sub
   
    'This function performs the lookup in the database to find a related page for the broken link.
    Function DoURLLookup(ByVal inURL As String) As Integer
        Dim cnn As New SqlConnection(ConfigurationSettings.AppSettings("connectionString").ToString)
        Dim myCommand As SqlCommand = New SqlCommand("SELECT NewTabID FROM " & _
             "NotFoundLookup WHERE OldURL = '" & Replace(inURL, "'", "''") & "'", cnn)
        cnn.Open()
        Dim result As SqlDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection)
        If result.Read Then
            Dim TabID As Integer = CType(result("NewTabID"), Integer)
            cnn.Close()
            Return TabID
        Else
            cnn.Close()
            Return -1
        End If
    End Function

End Class

 

if we  change on UrlRewriteModule.vb file

            ' if a match was found to the urlrewrite rules
            If intMatch <> -1 Then
                If rules(intMatch).SendTo.StartsWith("~") Then
                    ' rewrite the URL for internal processing
                    RewriterUtils.RewriteUrl(app.Context, sendTo)
                Else
                    ' it is not possible to rewrite the domain portion of the URL so redirect to the new URL
                    Response.Redirect(sendTo, True)  // Replace with 404.aspx page
                End If
            End If

i have not implited this code.

Is that  possible to Redicrect on 404 Error page if URL not or found?

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Dotnetnuke Url Rewriter Dotnetnuke Url Rewriter


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out