 |
 |
Script to redirect website
|
 |
|
 |
|
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status:
Offline
|
|
Hi,
I am exceeding my bandwidth with my current web hosting company so whenever someone tries to connect they get a 408 Request Timeout error. I have space on some other servers, like my .Mac account, but I don't know how to redirect users. Does anyone know how I can make it so that when a user gets a 408 error they will get redirected to a different URL?
I don't know much about web programming, so any help would be greatly appreciated.
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Dec 2002
Status:
Offline
|
|
That's something you'd have to discuss with your webhoster, since that's server-side configuration. Unless you have access to server configurations? It's fairly technical though. I'd suggest contacting your host first and then come back here.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status:
Offline
|
|
I asked my webhoster and this is what they said:
Create one error page and and store it in your httpdocs.So whenever you get the error 408 it will redirected to your customised page.
You can do this by adding the following line in your .htaccess file,
ErrorDocument 408 /path your error page.
I just don't know exactly how to code it?
Can someone post an example?
Thanks.
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status:
Offline
|
|
Originally posted by macrophyllum:
I asked my webhoster and this is what they said:
Create one error page and and store it in your httpdocs.So whenever you get the error 408 it will redirected to your customised page.
You can do this by adding the following line in your .htaccess file,
ErrorDocument 408 /path your error page.
I just don't know exactly how to code it?
Can someone post an example?
Thanks.
Just what they said, essentially!
Create a file on your desktop using (preferably) BBEdit, making sure UNIX style linefeeds are being used rather than Mac linefeeds - UNIX hates the combination of /r/n. You could also try using TextEdit on Mac OS X, or indeed any other text editor that allows you to create plain text files with UNIX style linefeeds.
(Note: I'm assuming you ARE using a UNIX/LINUX server... if you're running a windows box, then obviously use DOS style linefeeds!)
Make a file called 'htaccess' - no extensions. The correct name is actually '.htaccess' but most editors won't let you create a file with a '.' at the front of the file in OS X (not sure about OS 9 - it's been a while..)
If you'd like to redirect your users to an address called 'http://www.your-other-url.com/index.html' then you need only create 1 line which says:
That's it! Now upload that file to your top-level web directory on your server (the same one your index.html or default.htm file is kept) and rename it to .htaccess.
Should work straight away, although you're not really going to get an accurate indication until you're exceeding your bandwidth again.
Hope that helps
|
|
Computer thez nohhh...
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Dec 2002
Status:
Offline
|
|
Good response except one thing: there's probably already a .htaccess file available when you log-on. Make sure you just edit this file rather than replacing it with a file that *only* has the 408 redirect on it. Good luck.
Travis
forté web design
edit:// Of course, if there isn't a file already just upload your own.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status:
Offline
|
|
Thanks folks! Works now. Once I uploaded the file I added "." to .htaccess.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|