By joseph56
Hi, i have an Odoo website running at http://example.com:1234.
I need http://example.com:1234 to automatically redirected to http://www.example.com.
Web server can be used Apache / Nginx whichever it is easy to configure.
Kindly guide me.
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!
Hello friend!
Is it that you want visitors to :1234 to be redirected to the base domain, or that you want what is visible at :1234 to be visible without having to add the :1234 to the URL? Most people ask for the second one, and both require a radically different approach.
In the case that you want :1234 to redirect to the base domain, you need a web server listening on port 1234 that takes all requests and routes them to port 80. If using Apache, you would use mod_rewrite to do the job:
https://httpd.apache.org/docs/2.4/rewrite/remapping.html
Your virtual host in this case would reference port 1234 instead of port 80, so this:
<VirtualHost *:80>
Would instead be this:
<VirtualHost *:1234>
Kind Regards, Jarland
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.