I have install ssl on my site , Everything works fine on https but I want to use secure urls only for checkout and registration area pages.

For that I have set base url to http://mydomain and Use Secure URLs in Frontend to Yes.

But Some of my urls (category pages) are still redirected to https (after giving 302 Moved Temporarily). And same with all ajax requests through out the site.

I checked .htaccess file and found no rule to redirect for those particular urls or any other url.

I also checked my server configuration for redirect of urls but there also no rules were applied. I also replace my .htaccess file default .htaccess but it makes no difference.

Does anyone have idea what could be the cause of it?

1 Answer 1


1) Use these commands to enable the modules.

sudo a2enmod rewrite
sudo a2enmod ssl

2) Check if your SSL is configured correctly on the file /etc/apache2/sites-available/000-default.conf like that.

<VirtualHost *:443>
    SSLEngine on
    SSLCertificateFile    <path to your crt file>
    SSLCertificateKeyFile   <path to your private key file>

    # Rest of your site config
    # ...

3) So you can use that on yours .htaccess file.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

4) Run this command to restart your Apache.

sudo service apache2 restart
  • its redirecting all urls to https.
    – mansi
    May 5, 2017 at 13:21
  • Make sure mod_rewrite is enabled in Apache May 5, 2017 at 13:24
  • yes it is enabled
    – mansi
    May 5, 2017 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.