My website www.mydomain.com is working fine but mydomain.com giving 403 Forbidden error.
I have Apache Ubuntu server. Here is my configuration.
My host file /etc/host
...
127.0.0.1 localhost
XX.XX.XX.32 mydomain.com www.mydomain.com
My mydomain.com.conf file
ServerName mydomain.com
ServerAlias www.mydomain.com
ServerAdmin admin@mydomain.com
DocumentRoot /var/www/mydomain.com/public_html
RewriteEngine on
RewriteCond %{SERVER_NAME} = mydomain.com [OR]
RewriteCond %{SERVER_NAME} = www.mydomain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
I already have configure A record to my IP address XX.XX.XX.32
I also set my CNAME to www.mydomain.com with TTL 43200
I have installed SSL for HTTPS as well. Having same above mydomain.com-le-ssl.conf
I already check root folder by removing with .htaccess its file. so no problem at htaccess file at all.
I am not sure what else I need to do. I am not able to access my website on mydomain.com or https://mydomain.com
Any suggestion please.
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!
Hi @ideveloper1990,
So you’ve configured your Hosts file. Let’s assume there are no typos there and see what can be causing the 403 Forbidden Error.
What I can suggest is for you to check your Apache Error Logs. That way you’ll see why exactly it’s giving the Error or if it’s at all reaching the Droplet. The Error log file should be located in /var/log/apache2/error_log or just somewhere in your /var/log/ folder.
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.