1

My Goal

My main website is being hosted by a 3rd party server (Netfirms to be precise). I want most of my content hosted there. However, I am running an employee portal on a local server. The portal relies on Python scripts which are not supported on Netfirms. The local server is reachable using a DDNS URL (localserver.dyndns.com, for example). I have setup a subdomain with my webserver host (portal.example.com, for example).

When employees browse to portal.example.com, I want the content served from localserver.dyndns.com. While Netfirms allowed me to create the redirect, their system simply generates an index.hml with the target url (localserver.dyndns.com) in a frameset. This, of course, destroys the responsiveness of the site.

What I've Tried

The easiest not frame-reliant solution was to create a .htaccess file containing the following:

Redirect /index.html http://localserver.dyndns.com

While that does redirect traffic to localserver.dyndns.com, the URL changes, so employees see that they are not at portal.example.com anymore. I have tried a few different rewrite condtions/rules to no success.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^portal.example.com$
RewriteRule ^(.*)$ http://localserver.dyndns.com/$1 [L,R=301]

or

RewriteEngine On
RewriteRule ^portal.example.com$ http://localserver.dydns.com/$1

I've even tried with(out) quotes and/or leading \ for "special" characters (\:, \/,\., for example), in seemingly endless variations. I either get 500 - Internal Server Error, Access Restricted, 401 - Not Found

Nothing seems to work. What am I missing/doing wrong?

1

You don't need to redirect, if you only serve content from localserver.dyndns.com under portal.example.com, and want to use portal.example.com as URL.

Create a DNS record for portal.example.com, as CNAME with value localserver.dyndns.com.

It will point portal.domain.com to whatever is the current IP of localserver.dyndns.com, and will not rewrite URL.

  • When I do this, I get a Server Not Found error. I verified that I can access localserver.dyndns.com directly, just fine. When I try from portal.example.com, I get the error saying, Server Not Found - Firefox cannot find the server at portal.example.com – Sirach Matthews Jan 4 '17 at 1:31
  • 1
    did you add portal.example.com CNAME record properly, you might be caching DNS on your side also? Visit mxtoolbox.com/CNAMELookup.aspx and check portal.example.com, and see what t returns. – rAlen Jan 4 '17 at 1:35
  • Thanks for that. I checked and confirmed the TTL is another 60 minutes yet, so patients is required, then we shall see. – Sirach Matthews Jan 4 '17 at 2:07

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.