Welcome to WebmasterWorld Guest from 50.16.24.12

Forum Moderators: Ocean10000 & incrediBILL & phranque

htaccess redirect

server returns 501 error

   
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?

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

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.

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...

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.

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...]
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!

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

My Threads

Hot Threads This Week

Hot Threads This Month

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved