Tomas Lucena
Tomas Lucena

Reputation: 1536

Redirect to another page with ASP

I am not an asp developer, I work with PHP. But my problem required a little bit of asp.

Google has stored in his database links from an old website. So that links are showed after a google search, and the people is going to a particular file that was done on the old website (with asp).

I have my new website and need to redirect from that old website to the new one. So I have made a small research and found that to redirect in asp I need to:

  <%
  Response.Redirect ("my website link");
  %>

But the file only print text and dont redirect to the my new link.

What I am missing? I need only redirect to a particular page.

EDIT

The name of the old file is members.asp

I dont have a way to avoid google to point to that file, but of course that files doesnt exist on my server. Now I have created it and try to redirect but I only get the code printed in plain text.

You can check the live result here:

http://kln.cuisinecourier.com.hk/members.asp?rest_id=K013&lang=eng&sort=&m=login

ANSWER

ok I just realized that I can run javascript easily :S the simplest way. sorry for bothre

Upvotes: 0

Views: 4033

Answers (3)

Kenny Page
Kenny Page

Reputation: 209

The Classic ASP code you have written, shown below, is correct:

<%
Response.Redirect "https://www.cuisinecourier.com.hk/en/hk/orderingGuide";
%>

but... Classic ASP is part of the Microsoft Internet Information Server (IIS) web server. The web server you are using to serve at the following URL:

http://kln.cuisinecourier.com.hk/members.asp?rest_id=K013&lang=eng&sort=&m=login

...is not running IIS, but is running Apache (Apache/2.4.9 (Unix) OpenSSL/1.0.1e-fips PHP/5.5.11 according to the headers). That web server does not process Classic ASP, hence it simply serves the unprocessed file contents.

Upvotes: 3

Nicolas Kadis
Nicolas Kadis

Reputation: 219

Try to redirect this way:

<%
Response.Redirect "http://www.yourwebsite.com"
%>

Source: w3school

Upvotes: 0

Riddhi Agrawal
Riddhi Agrawal

Reputation: 9

Response.Redirect("Account/login.aspx"); will redirect to new page so check you give proper path to redirect or not.

Upvotes: -1

Related Questions