Forum Moderators: phranque

Message Too Old, No Replies

Getting a 500 error on a 301 redirect.

Did a 301 redirect via .htaccess and got a 500

         

ballada

1:05 pm on Oct 22, 2006 (gmt 0)

10+ Year Member



Hi, I am in the deep brown stuff.
My problem started when I created my site using sub domains (these are working ok), but I realised that in order to keep those names I should also buy the domains before anybody else did, so I did it by also creating add on domains. Then I noticed that as well as say, www.subdomain.mysite.com appearing in the search engines, www.subdomain.com was also appearing. I tried to find a way to redirect permenantly through the Cpanel but was not able to. I sent support tickets and finally my host said just create a redirect in a .htaccess file and put it in the add on domain folder.

I have done this using this code
redirect 301/subdomain.com/index.html http:www.subdomain.mysite.com/new html

I am now getting a 501 alert, which from my error message centre says:-

Sun Oct 22 ] [alert] [client ] /home/mysiteusername/public_html/subdomain/.htaccess: Redirect to non-URL

Can any one put me straight?

Sorry to be long winded.

Dominique

jdMorgan

1:46 pm on Oct 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Syntax-wise, it appears that you're missing a space, two slashes, and a period:

Redirect 30[b]1 /s[/b]ubdomain.com/index.html htt[b]p://w[/b]ww.subdomain.mysite.com/ne[b]w.h[/b]tml

That may not fix any functional problems you may have, but it will at least correct the directive and URL syntax problems.

Jim

ballada

3:03 pm on Oct 22, 2006 (gmt 0)

10+ Year Member



Hi, thanks for your reply it is amazing what a space and line can do. Alas I have realised that my problems go deeper than this but that is another story for another forum.

Can I use this code to correct cannonical problems eg redirecting mysite.com to www.mysite.com and if so where would I put the file, just in the public/html folder on the server?

Regards Dominique

g1smd

4:00 pm on Oct 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes you can.

See the last block of code in the post at: [webmasterworld.com...] for that.