Skip to content

Instantly share code, notes, and snippets.

@avtaniket
Created August 29, 2016 13:30
Show Gist options
  • Save avtaniket/36051a4d79fe49e11fd4f8a94d478aec to your computer and use it in GitHub Desktop.
Save avtaniket/36051a4d79fe49e11fd4f8a94d478aec to your computer and use it in GitHub Desktop.
localhost to custom domain in ubuntu
Step 1: Add domain entry in hosts file (vim /etc/hosts)
127.0.0.1 dev.mywebsite.com
Step 2: Add redirection policy in IP-Tables
sudo iptables -t nat -A OUTPUT -o lo -p tcp --dport 80 -j REDIRECT --to-port 8888
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment