Solved

Redirect a webpage?

Posted on 1998-09-25
14
531 Views
Last Modified: 2013-12-23
I have an account on a UNIX web server which allows me to store my webpage. However, I would like my webpage to reside with another provider and would hence like to set up a redirect to the new server. My sysadmin is out of town so I cannot ask him, and I do not want to create on of those 'You are being forwarded' client pull (meta redirect) pages. Since UNIX features such files as .forward and .htaccess I am wondering if there is a way--a file or a setting--which I can create/specify from my account in order to redirect browser by default (ie by sending a Location: %url% header to the browser).

Any ideas?
0
Comment
Question by:MaDdUCK
14 Comments
 
LVL 3

Expert Comment

by:zhongbing
Comment Utility
serveral ways to do it, one is use javascript, but you should changed the html file in your oringinal site. following is an example:

HTML>
<title> test page </title>
<head>
<script language="JavaScript">
window.location="http://newsite/newhtml.html";
</script>
</head>
<body>
5555555555555555
</body>
</HTML>
0
 
LVL 8

Author Comment

by:MaDdUCK
Comment Utility
nope, I do not want any Java or the like. Just a pure UNIX function not even involving any HTML.
0
 

Expert Comment

by:bjornh
Comment Utility
<META HTTP-EQUIV="REFRESH" CONTENT="0;URL=http://www.domain.com/yourpage">
0
 
LVL 8

Author Comment

by:MaDdUCK
Comment Utility
Read my question please ... no meta redirects!
0
 

Expert Comment

by:bjornh
Comment Utility
what you want is not possible
0
 
LVL 8

Author Comment

by:MaDdUCK
Comment Utility
are you sure? I know people who have a feature like this with their accounts. Do you have to contact the webmaster?
0
 
LVL 2

Expert Comment

by:squint
Comment Utility
If you only need to redirect specific pages, *and* your admin had set up the server to allow .htaccess files...

In your .htaccess:

AddHandler send-as-is .html

----------

In your index.html:

Location: http://www.newserver.com

----------

Make sure there is no blank line in front of "Location" and at least two blank lines after the line.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 8

Author Comment

by:MaDdUCK
Comment Utility
I operate two accounts, one on linux, one on unix. the linux one now offers me to dowload ~madduck (my home dir) when I access it with IE, the unix one gives an internal server error. Both servers allow .htaccess...what am I doing wrong?
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
If you change ISP, you also change your domain, means that the new FQDN is different to the previous one.
If you don't want a redirect-page on your old side, the only way is to tell the client to use the new domain.

If you would like to program, IP packets know a "ICMP redirect"
which is exactly what you need, but unfortunately this mechanism will be rejected by most servers (because of vulnerability).
0
 
LVL 8

Author Comment

by:MaDdUCK
Comment Utility
I am not changing ISP's, all I want is to use a different ISP, but keep this current address as an entry point.
0
 
LVL 5

Expert Comment

by:tfabian
Comment Utility
it depends on the server software, but generally, it's not something that's under the control of a user..  

you can use the meta redirect described above, or you can use a perl script to redirect, or you can have your admin update the redirect file in the server configuration..


good luck



0
 
LVL 8

Author Comment

by:MaDdUCK
Comment Utility
I do not want
(a) use meta redirect
(b) use perl or CGIs (no access)
(c) contact my webmaster

htaccess files should be under the user's control. squint is pretty much on track, so now I gotta figure out why it does not work.
0
 
LVL 1

Accepted Solution

by:
Strange earned 50 total points
Comment Utility
If your WEB-server is Apache then you can try thic command in
htaccess file in your public html (~home) directory
Redirect [status] url-path url
for example:
Redirect /~madduck http://yor.new.www/

But your webmaster can disallow you to use such commands
In these case you better do that, what you dont wont to.

Oh, the status is:
permanent - Returns a permanent redirect status (301)
temp - Returns a temporary redirect status (302).
seeother - Returns a "See Other" status (303)
gone - Returns a "Gone" status (410)

0
 
LVL 8

Author Comment

by:MaDdUCK
Comment Utility
whoa, worked!!!
thanks a bunch!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
Even if you have implemented a Mobile Device Management solution company wide, it is a good idea to make sure you are taking into account all of the major risks to your electronic protected health information (ePHI).
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now