Hello, I set up a new droplet with the wordpress default, I also enabled ssl with the certbot, i asked for the cert bot to configure a forward of http to https, but it didn’t work for me. I’ve tried adding the permanent redirect line in the config file, but it doesn’t seem to have taken it up? Location: /etc/apache2/sites-enabled/000-default.conf here’s my config:
UseCanonicalName On
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName 40acresproject.com
ServerAlias www.40acresproject.com
Redirect permanent / https://40acresproject.com/
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =40acresproject.com [OR]
RewriteCond %{SERVER_NAME} =www.40acresproject.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
Thanks in advance for your help!
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 @garfield1979 ,
Open
Apache/conf/httpd.conf
find
#LoadModule rewrite_module modules/mod_rewrite.so
and delete #
Overwrite .htaccess with
RewriteEngine on
RewriteBase /
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
Then restart Apache service.
Kind regards, Shiroka
Thanks for the help.
So I’ve looked for httpd.conf file, I cannot find it. the only conf file referenced in apache is 000-default.conf (which contents i posted above) there also is no .htaccess file present anywhere in the website.
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.