What setting to I have to put in DNS at DO for a domain, so that www.domain.com/whatever to be redirected to domain.com/whatever?
And what setting to put so that if someone tries to access a non existing subdomain (like szdakshd.domain.com) to be redirected to domain.com? Or if not in DNS settings, where?
Thanks.
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!
@sierracircle What Apache version is the advice for? What Linux distro is this for? I tried this and got this error on a CentOS 7 running Server version: Apache/2.4.6 (CentOS) and I got this error:
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
First of all, aren’t we supposed to be editing our Apache Config Files located in /etc/httpd/sites-available? not sites-enabled? Secondly, is our example.com.conf supposed to look like this advice:
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
DocumentRoot /var/www/example.com /public_html
ErrorLog /var/www/example.com /error.log
CustomLog /var/www/example.com /requests.log combined
</VirtualHost>
<Directory /var/www/yourwebfolder>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
Require all granted
</Directory>
This is my question. And lastly, isn’t yourwebfolder supposed to be called a document root? Or are they different? My last question is for Digital Ocean. Can we please get a qualified document that helps CentOS 7 customers make it so the same page with both www.example.com and example.com have good DNS but we want people who go to both pages only END UP on the example.com domain please? Thanks in advance.
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.