1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Asp Redirect

Discussion in 'C#' started by Turnkey Websites, Oct 1, 2007.

  1. #1
    Hello,

    I have an html page (index.html) I want to redirect to /folder/default.asp how can I do this?
    thanks
     
    Turnkey Websites, Oct 1, 2007 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Are you wanting it to be transparant to the end user or invisible?

    If it is transparant then simply put a meta redirect would do the job.

    If it is invisible it is a bit of a pain with IIS as it requires making modifications to the server itself
     
    AstarothSolutions, Oct 2, 2007 IP
  3. seo_chatbox

    seo_chatbox Peon

    Messages:
    60
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ASP Redirect code

     
    seo_chatbox, Oct 2, 2007 IP
  4. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #4
    but the user says it is a .html file
     
    AstarothSolutions, Oct 2, 2007 IP
  5. ashrafweb

    ashrafweb Member

    Messages:
    67
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #5
    use simple javascript
    location.href="http://www.new-url.com";
    it will work correctly
    see this example http://www.palweb.net
     
    ashrafweb, Oct 3, 2007 IP
  6. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #6
    here you go
    source: HTML Redirect
     
    ludwig, Oct 6, 2007 IP
  7. chickens

    chickens Peon

    Messages:
    242
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #7
    That doesn't work for those of us who run with javascript disabled by default. All I see is a black page with some really hard text to read that says go.

    A meta refresh will work with out without javascirpt enabled.
     
    chickens, Oct 6, 2007 IP
  8. Forrest

    Forrest Peon

    Messages:
    500
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Write an HttpHandler in asp.net. Or delete the file and use your 404 page to send down a redirect. I'm writing an article on a more elaborate way to accomplish that for http://blog.exo-brain.com.
     
    Forrest, Oct 6, 2007 IP
  9. longcall911

    longcall911 Peon

    Messages:
    1,672
    Likes Received:
    87
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Not sure why you feel you need to redirect it. You can just delete it and replace it with default.asp. All site navigation to the home page should really be http://www.yoursite.com/ anyway rather than http://www.yoursite.com/index.html.

    You should first check to be sure your hosting company permits default.asp as a valid root page. Most do, but I've run across a few that I've had to add to the list. To check, you can just create a new folder and put a default.asp in it then go to the new folder itself, not the default doc (http://www.yoursite.com/newFolder/). It should display. If not, check the host admin panel for a list of valid default page names and add default.asp if necessary.

    /*tom*/
     
    longcall911, Oct 9, 2007 IP
  10. iShopHQ

    iShopHQ Peon

    Messages:
    644
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #10
    check with your hositng company to make sure they have default.asp in teh default pages list and then just delete index.html
     
    iShopHQ, Oct 15, 2007 IP
  11. Forrest

    Forrest Peon

    Messages:
    500
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #11
    You don't want to simply delete index.html w/o a 301 redirect if the page has any decent links ... and if it's showing up in the address bar in peoples' browsers that's always a possibility.
     
    Forrest, Oct 16, 2007 IP
  12. visionfez

    visionfez Peon

    Messages:
    84
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #12
    If you don't want to lose search engine rating (backlinks ++) the only way is to set header "301 Moved Permanently".

    This is posted under the ASP category so i expect the server support .asp files. So i would delete the index.html file, and set a ISAPI filter to redirect index.html to index.asp (in this asp file you put the code posted by seo_chatbox).

    This way you keep your rating, the search engines get noticed that you have moved the page, and everything is fine :)

    I have needed to use this method on many pages of my customers.
     
    visionfez, Oct 20, 2007 IP
  13. ashrafweb

    ashrafweb Member

    Messages:
    67
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #13
    why you dont use javascript?
    its simple as 1+1=2
    
    window.location.href="myfolder/mysite";
    ///or if you want to redirect the page to any link for example >> http://www.e-msjed.com/Msjed/site/Details.asp?TopicID=739
    
    window.location.href="http://www.e-msjed.com/Msjed/site/Details.asp?TopicID=739"
    
    Code (markup):
    best wishes
     
    ashrafweb, Nov 25, 2007 IP
  14. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #14
    ludwig, Dec 24, 2007 IP
  15. <echo

    <echo Well-Known Member

    Messages:
    226
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    128
    #15
    Why not rename index.html to index.asp and redirect:

    <%
    Response.Redirect("/folder/default.asp")
    %>
     
    <echo, Jan 12, 2008 IP
  16. Link.ezer.com

    Link.ezer.com Peon

    Messages:
    647
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    0
    #16
    a trick for you:

    1: delete index.html
    2: create index.html.asp <---- so you can run asp now

    :D
     
    Link.ezer.com, Jan 14, 2008 IP
  17. mwasiqansari

    mwasiqansari Banned

    Messages:
    174
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #17
    <html>
    <head>
    <meta http-equiv="refresh" content="0; url=http://www.new-url.com">
    </head>
    <body>
    </body>
    </html>

    You can try the code mentioned above.
     
    mwasiqansari, Jan 17, 2008 IP
  18. ivnj

    ivnj Banned

    Messages:
    457
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #18
    Ya I also use that method.

    ivnj
     
    ivnj, Jan 17, 2008 IP
  19. webexpert

    webexpert Banned

    Messages:
    188
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #19
    ofcourse you can try this;

    <html>
    <head>
    <meta http-equiv="refresh" content="0; url=http://www.webdevelopmenthouse.com">
    </head>
    <body>
    </body>
    </html>

    but another way can be via javascript;

    <html>
    <body onload="javascript: window.location='http://www.webdevelopmenthouse.com'">
    </body>
    </html>
     
    webexpert, Jan 17, 2008 IP
  20. ariese

    ariese Banned

    Messages:
    48
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #20
    Try to edit 404-not found file. and redirect through it.
     
    ariese, May 20, 2008 IP