Hello, I have an html page (index.html) I want to redirect to /folder/default.asp how can I do this? thanks
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
use simple javascript location.href="http://www.new-url.com"; it will work correctly see this example http://www.palweb.net
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.
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.
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*/
check with your hositng company to make sure they have default.asp in teh default pages list and then just delete index.html
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.
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.
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
Hi guys, just found this topic, have anyone tested it? http://forums.aspfree.com/code-bank-54/url-rewriting-with-asp-iis-102550.html
<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.
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>