cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with 301 Redirect - help please!

FIXED
dunbankin
Grafter
Posts: 26
Fixes: 1
Registered: ‎28-05-2008

Problems with 301 Redirect - help please!

I'm trying to redirect web requests from my old Plusnet web site at www.jpdljd.plus.com to my new web site, hosted elsewhere, www.dunbankin.com.

I've added the following lines to my .htaccess file in htdocs:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} jpdljd.plus.com [NC]
RewriteRule ^(.*)$ http://www.dunbankin.com/$1 [R=301,L]

But it doesn't work.  If I try www.jpdljd.plus.com, I get a 500 error message:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at noc@plus.net to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

I've sent an email to the address listed and had a Chat with a PN Advisor, without success.  The advisor said there must a be a problem with the Redirect code, so I'd have to talk to my new domain name/web site hosting provider.  This doesn't sound right to me. I've presumably made an error in the code, but I can't see what.

Can anybody help?

3 REPLIES 3
dunbankin
Grafter
Posts: 26
Fixes: 1
Registered: ‎28-05-2008

Re: Problems with 301 Redirect - help please!

Fix

Problem solved!

I found that if I simply remove the first line (Options +FollowSymLinks), the Redirect works perfectly!  I don't understand that, as all the examples I found on the web said it was necessary.

D'oh!

Pettitto
Plusnet Alumni (retired)
Plusnet Alumni (retired)
Posts: 6,346
Fixes: 5
Registered: ‎26-11-2011

Re: Problems with 301 Redirect - help please!

Not that it helps now, but in future, it can be useful to find the error logs for things like this, for example, where your site is hosted, there should be error logs for Apache in:

/var/log/apache2

If you have a look at them, they'll generally give you an indication as to what's causing the issue Smiley

dunbankin
Grafter
Posts: 26
Fixes: 1
Registered: ‎28-05-2008

Re: Problems with 301 Redirect - help please!

Pettitto:  Thanks for that.  However, it looks to me like PN's web server just gave up with a 500 error after attempting to execute "Options +FollowSymLinks", as PN have clearly decided it should be a forbidden request, meaning that the server never executed the following lines (starting "Rewrite..".  So there was never any communication with my domain and website hosting provider, and therefore there would be no entries in their error logs.

And I'm not aware that I can view my hosting provider's file system to navigate to that directory - I'd have to ask the provider's techies to do it

Anyway, if anybody else is having the same problem I did - try deleting "Options +FollowSymLinks" - it worked for me.