By salishraza
Hello Friends When any one Type my IP Address Like 123.132.xxx.xx on browser address bar then my main site is show i want to redirect my ip address to main domain name i’m using Ubuntu and vesta cp panel any one can tell me how can i redirect my domain name to my website…
Thanks in advance
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
With NGINX, you can edit nginx configuration file add this code server { listen 80; server_name yourdomain.com; 301 redirect http://yourdomain.com$request_uri;
}
You can do that via the Web Server configuration files.
If using Apache, you would need to add this to your configuration setup:
ServerName domain.com
If using Nginx, you would need to add this to your configuration setup:
server_name domain.com
Please remember you would need to restart the Web Server after making such changes. For more information on setting that up, you might want to read our guides on Setting up Apache VirtualHosts and Setting up Nginx Server Blocks.
Also please note if you are using a CMS, such as WordPress or Magento, you would need to edit the database entries that determine the site/home URLs. You can normally do this via the CMS admin panel, or directly via MySQL.
Hope it helps! Jason Colyer DigitalOcean Platform Support Lead
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.