Problems with 301 Redirect - help please!
FIXED- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Other forums
- :
- Tech Help - Software/Hardware etc
- :
- Problems with 301 Redirect - help please!
09-07-2017 4:29 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
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?
Fixed! Go to the fix.
09-07-2017 4:40 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
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!
Re: Problems with 301 Redirect - help please!
09-07-2017 11:07 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
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
Re: Problems with 301 Redirect - help please!
10-07-2017 9:47 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
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.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Other forums
- :
- Tech Help - Software/Hardware etc
- :
- Problems with 301 Redirect - help please!