This project builds a simple redirector from non-www.* to www.*
This is a solution to a DNS oddity that does now allow a non-www root hostname (such as perfect.org) to have a CNAME record to a multi-zoned load balancer such as what AWS provides.
It builds with Swift Package Manager and produces a stand-alone HTTP executable.
The master branch of this project currently compiles with Xcode 8.2 or the Swift 3.0.2 toolchain on Ubuntu.
The following will clone and build the project and launch the server on port 80.
git clone https://github.com/PerfectExamples/WWWRedirector.git
cd WWWRedirector
swift build
.build/debug/WWWRedirector
You should see the following output:
[INFO] Starting HTTP server localhost on 0.0.0.0:80
This means the server is running and waiting for connections.
It is recommended that you use Perfect Assistant to deploy, but if you are unable to use PA to deploy please follow the appropriate steps as outlined in the Medium article "Deploying Server Side Swift to Linode"
We use JIRA for all bugs and support related issues, therefore the GitHub issues has been disabled.
If you find a mistake, bug, or any other helpful suggestion you'd like to make on the docs please head over to http://jira.perfect.org:8080/servicedesk/customer/portal/1 and raise it.
A comprehensive list of open issues can be found at http://jira.perfect.org:8080/projects/ISS/issues
For more information on the Perfect project, please visit perfect.org.