Help with htaccess 301 error

  • madisonlist
  • Novice
  • Novice
  • No Avatar
  • Joined: Feb 03, 2004
  • Posts: 15
  • Status: Offline

Post February 3rd, 2004, 12:31 pm

:oops: sorry to say, i know some things, but others just escape my mind.
I saw all the posts on 301 error codes but noone, wrote on competetly out so that you maybe wudn't get lost with it.
I wrote one to add to the ones in hta already, it still gives me my page, but do I need to make an error page for this too?
I work in frontpage 2002. I need this error code for 3 domain names that point to my site because I believe that dropping from the top 10 in google is going to make my sites go under.....they are on the way....HELP PLEASE ANYONE??????? REAL INSTRUCTIONS???? for a dummy :shock:
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post February 3rd, 2004, 12:31 pm

  • madisonlist
  • Novice
  • Novice
  • No Avatar
  • Joined: Feb 03, 2004
  • Posts: 15
  • Status: Offline

Post February 3rd, 2004, 4:06 pm

Don't look like nobody is going to answer me?
:(
  • Axe
  • Genius
  • Genius
  • User avatar
  • Joined: Jan 07, 2004
  • Posts: 5755
  • Loc: Sub-level 28
  • Status: Offline

Post February 3rd, 2004, 7:56 pm

Don't look like nobody can understand a word you're saying ;)

Try to form a more accurate sentence structure with your questions, along with examples of what you're doing right now, in what way it's not working in the form you desire, and what you would like to do to change the way things are working.

When you say "hta", do you mean .htaccess? If so, say that, if not, then you can see how confusion can start, making it impossible for people to answer your questions :)
John
» PHP Scripts & Resources » Free Photoshop Tutorials
» Anybody wanna pay my mortgage? PM me!
  • madisonlist
  • Novice
  • Novice
  • No Avatar
  • Joined: Feb 03, 2004
  • Posts: 15
  • Status: Offline

Post February 3rd, 2004, 8:06 pm

Its me, and you all say HTA a lot in here. Look at posts in here.
Its an error code 301 which I already mentioned.
Its a HTAACCESS CODE 301 for redirecting a domain which you all already have that in here. BUT I NEED someone to give me an example of an htaccess 301 error code
I know this much
ErrorDocument 301 / oldsite/newsite

does that automatically redirect????? and DO [AS I SAID] I NEED AN ERROR PAGE AS WELL????? and HOW DO I SET THAT UP????

I'm not entirely stupid here. Just asking for help........maybe this wasn't such a good idea :roll:
  • Axe
  • Genius
  • Genius
  • User avatar
  • Joined: Jan 07, 2004
  • Posts: 5755
  • Loc: Sub-level 28
  • Status: Offline

Post February 3rd, 2004, 8:23 pm

ErrorDocument 301 http://www.somedomain.com
ErrorDocument 301 /error301.html

Just one of those lines in a .htaccess file, with the correct URL of wherever you want to send somebody, will automatically forward people to the URL you specified in the event of an Error 301.

Exactly the same as any other error... For example..

ErrorDocument 404 /error404.html

If they went to a URL that didn't exist it would send them to /error404.html where you would explain that the URL they're attempting to locate does not exist. :)
John
» PHP Scripts & Resources » Free Photoshop Tutorials
» Anybody wanna pay my mortgage? PM me!
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Joined: Jun 15, 2003
  • Posts: 4584
  • Loc: New York
  • Status: Offline

Post February 3rd, 2004, 8:30 pm

can you pass variables with that? like /error.php?er=301
Pixel Acres V2
  • madisonlist
  • Novice
  • Novice
  • No Avatar
  • Joined: Feb 03, 2004
  • Posts: 15
  • Status: Offline

Post February 3rd, 2004, 8:37 pm

I appreciate the straight answer, and sorry if I broke rules, or didn't speak plain.
Have a nice nite. :D God Bless you
  • rjmthezonenet
  • Expert
  • Expert
  • User avatar
  • Joined: Jan 14, 2004
  • Posts: 527
  • Loc: St. John's, Newfoundland, Canada
  • Status: Offline

Post February 3rd, 2004, 8:53 pm

b_heyer wrote:
can you pass variables with that? like /error.php?er=301


Yes, but you would be passing the same variable each time. The only thing I think is possible would be your example; having a common error script that changes behaviour (hopefully) depending on the exact error. Under normal circumstances (maybe I missed something), it would be more efficient to have individual errors scripts (eg. 301.php, or 404.php).
  • Axe
  • Genius
  • Genius
  • User avatar
  • Joined: Jan 07, 2004
  • Posts: 5755
  • Loc: Sub-level 28
  • Status: Offline

Post February 3rd, 2004, 8:55 pm

As far as I know you can b_heyer, because PostNuke's default Error404 sends you to /error.php?op=404

So, presumably you could have like..

/error.php?op=404

for file not found...

/error.php?op=500

for internal server (script) error...

And have your PHP script pull the right info to send to the user accordingly.
John
» PHP Scripts & Resources » Free Photoshop Tutorials
» Anybody wanna pay my mortgage? PM me!
  • rjmthezonenet
  • Expert
  • Expert
  • User avatar
  • Joined: Jan 14, 2004
  • Posts: 527
  • Loc: St. John's, Newfoundland, Canada
  • Status: Offline

Post February 3rd, 2004, 8:58 pm

Axe wrote:
/error.php?op=500 ...for internal server (script) error...


This raises a related point. Shouldn't the 5xx error messages point to text/html pages just in case the server is sick; not the script.
  • Axe
  • Genius
  • Genius
  • User avatar
  • Joined: Jan 07, 2004
  • Posts: 5755
  • Loc: Sub-level 28
  • Status: Offline

Post February 3rd, 2004, 9:11 pm

That could be a very good idea... although, if the server is sick, whether the user sees the error page or not is probably the least of your concerns, lmao.
John
» PHP Scripts & Resources » Free Photoshop Tutorials
» Anybody wanna pay my mortgage? PM me!
  • madisonlist
  • Novice
  • Novice
  • No Avatar
  • Joined: Feb 03, 2004
  • Posts: 15
  • Status: Offline

Post February 3rd, 2004, 9:35 pm

Hi again,

I put in the error code 301 like you said.
I did not put a redirect, or anything except the url where i wanted the page to go.
Will google now read it as a permnantly moved page?
OR do I need something else in there.
the error codes I have are as follows:

ErrorDocument 404 http://.net from server
ErrorDocument 206 http://.net from server

ErrorDocument 401 http://.net from server
ErrorDocument 403 http://.net from server

ErrorDocument 500 http://my first .com domain on the server
ErrorDocument 302 http://www.firstdomain

ErrorDocument 301 http://www.newdomain
ErrorDocument 301 http://www.newdomain

any help? or is this all I need. It works. they already have my first.com and my new domains directing to the .netfrom the server
I just want to make sure that this gets read right......thanks
  • rjmthezonenet
  • Expert
  • Expert
  • User avatar
  • Joined: Jan 14, 2004
  • Posts: 527
  • Loc: St. John's, Newfoundland, Canada
  • Status: Offline

Post February 4th, 2004, 7:51 am

You should quickly read the Status Code Definitions of RFC2616. I don't feel 100% that you are accomplishing what your intend.

Quote:
10.3.2 301 Moved Permanently

The requested resource has been assigned a new permanent URI and any future references to this resource SHOULD use one of the returned URIs.

http://www.ietf.org/rfc/rfc2616.txt?number=2616


If Google conforms to the HTTP/1.1 standard, it will refer to the new page on future requests.

Why are you using 201 Created, and 206 Partial Content?
  • madisonlist
  • Novice
  • Novice
  • No Avatar
  • Joined: Feb 03, 2004
  • Posts: 15
  • Status: Offline

Post February 4th, 2004, 8:22 am

I really don't know, someone helped me set that up 2 years ago.
I probly don't need that do I?
  • rjmthezonenet
  • Expert
  • Expert
  • User avatar
  • Joined: Jan 14, 2004
  • Posts: 527
  • Loc: St. John's, Newfoundland, Canada
  • Status: Offline

Post February 4th, 2004, 8:33 am

If you want a fancy 404 page (broken links, i.e. http://wp.netscape.com/broken-link/), go for it. Use the 301 page to re-direct user-agents to re-located pages. They're both fairly safe.

Avoid the rest unless you know exactly what they are and why you are using them. It is very easy to make a bad situation worse by messing with the normal behaviors of a service.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post February 4th, 2004, 8:33 am

Post Information

  • Total Posts in this topic: 22 posts
  • Users browsing this forum: No registered users and 178 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© Unmelted Enterprises 1998-2009. Driven by phpBB © 2001-2009 phpBB Group.