Welcome to WebmasterWorld Guest from 54.226.189.112

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

htaccess redirect

server returns 501 error

     

Bran

1:26 pm on May 7, 2002 (gmt 0)

10+ Year Member



Help!

I have transferred pages from the root into a folder and want to redirect SE's to the new location via redirectpermanent.

I used the following

RedirectPermanent /oldlocation.htm /http://www.mydomain/folder/newlocation.htm

and it always returns a 501 server error

I also tried

Redirect 301 (rest as above ....)

and

Redirect permanent (rest as above...)

This is the ONLY line in the .htaccess file - should there be something else in there?

jdMorgan

1:37 pm on May 7, 2002 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



No need for leading slash on "http:" i.e.
RedirectPermanent /oldlocation.htm [mydomain...]
should work.

If you want to redirect all files, rather than just oldlocation.html, try:
RedirectPermanent / [mydomain...]

Here's one I pulled off one of my old servers that I am actually using to redirect a "homepage" type account (with the tilde-name setup):
RedirectPermanent /~quux-corp/ [quux-corp.com...]

Hope this helps!
Jim

sparrow

1:37 pm on May 7, 2002 (gmt 0)

10+ Year Member



I think you have one to many forward slashes...
RedirectPermanent /oldlocation.htm /http://www.mydomain/folder/newlocation.htm

it think it should read

RedirectPermanent /oldlocation.htm [mydomain...]

I don't believe you want the "/" before the [.....]

I just checked mine and I dont have that "/" in my redirects.

Bran

1:50 pm on May 7, 2002 (gmt 0)

10+ Year Member



Sorry about that - it was typo...

should have read:

RedirectPermanent /oldlocation.htm [mydomain...]

with no breaks

btw, thanks for the speedy response...

jdMorgan

2:16 pm on May 7, 2002 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Hmmm...

Error code 501 is "Not implemented" - I wonder if that's the problem?

You could try:
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^oldlocation.htm$ [mydomain...] [R=permanent]

(Note: The RewriteRule all goes on one line, but appears wrapped to two or three lines here in the forum. The rule starts with "RewriteRule" and ends with "[R=permanent]")

I'm assuming that you only want to redirect the single file called "oldlocation.htm".

It may also be that your hosting service has not installed mod_rewrite, which is an optional module available in Apache 1.2 and later.

jdMorgan

2:28 pm on May 7, 2002 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Sorry, thinking one thing, and wrote something else... I meant to say:
It may be that your hosting provider has disabled .htaccess using AllowOverride None.
RedirectPermanent is part of mod_alias, not part of mod_rewrite. Doh!
Your RedirectPermanent (without the "/" in front of "http:") otherwise looks correct.
[httpd.apache.org...]

Bran

3:57 pm on May 7, 2002 (gmt 0)

10+ Year Member



Thanks Guys

Its working great now - the host had not enabled htaccess - the code was actually fine.

...but being a novice you always think you have done something wrong...and often have!

jdMorgan

7:00 pm on May 7, 2002 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Bran,

Glad to hear you got it working!
Jim

 

Featured Threads

Hot Threads This Week

Hot Threads This Month