Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

redirect variable problem

Status
Not open for further replies.

stemitch2000

Programmer
Joined
Nov 12, 2003
Messages
47
Location
GB
Hello,

The problem. My website has been migrated to a new server. I would like to put redirects on every page to send clients to the correct page. I could hard code the redirects, i.e.

<meta http-equiv=&quot;refresh&quot; content=&quot;0; URL=http://www.my-old-website.com/temp/redirected.html&quot;>

But I would then have to hard code the redirect on ever single page (change the web address).

Is there a in built function to do this, or do I have to code it myself? If I do have to recode it my self....

Is there a way of grabbing the current location of the page on the old website, and then joining it to the new website name?

i.e.

grabbing the &quot;temp/redirected.html&quot;
(alt. grabbing the whole address, and chop off the putting it into a variable, and joining it to the new site?

location = &quot;temp/redirected.html&quot;

<meta http-equiv=&quot;refresh&quot; content=&quot;0; URL=http://www.my-new-website.com/<%=&quot; &location &quot;%> &quot;>
 
You could creayta cutom 404 page using ASP, creata table in Access or SQL athat lists the old URL and the NEw URL. Quoery that tbale for the old URL and do a response.redirect to the new URL.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top