I recently installed my SSL certificates on a D7 install and verified that they work by visiting my root domain.
The problem is that when I try to go to any node or subpage with Clean URLs enabled, I get a 404 page not found. When I put in the full index.php?q= URL, then it works without issue. This is what leads me to think it is a problem with how D7 internally handles clean URLs with SSL.

Non SSL works fine.

I want to support both HTTP and HTTPS on my site while forcing some directories to SSL.

How do I modify either my .htaccess or internal D7 config to allow clean URLS to work with SSL transparently, without forcing the entire site to SSL?

Thanks

Comments

matthewn’s picture

Had this same problem myself. Came to find that although "AllowOverride All" was set in the Apache config for the http side of things, "AllowOverride None" was set in the Apache config for the https site. Changing "None" to "All" got Clean URLs working on the ssl version of the site. Hope this helps.

sgdev’s picture

Just like to bump this up for those looking for the solution, and add some extra keywords on which others might be searching.

In Ubuntu, the default-ssl file is located in the "/etc/apache2/sites-available" directory. Within this file, there is an "AllowOverride None" statement inside the "/var/www/" directory of the default "VirtualHost _default_:443". See the beginning of the default-ssl file, shown below:

<IfModule mod_ssl.c>
<VirtualHost _default_:443>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

As matthewn noted, change "AllowOverride None" to instead read "AllowOverride All". Also make sure to restart Apache. On Ubuntu this would be done by using the "service apache2 restart" command.

mcgeehon’s picture

Yes, that was it. Thank you!!

taggartj’s picture

Yes i was having the same issue running Vagrant Ubantu box where http calls were All fine but https calls broke clean urls you could do /index.php?q=admin but /admin would break ... show page not found ...so first thought was got to be a .htaccess issue but nope !

it totally was AllowOverride All in /etc/apache2/sites-available/default-ssl

so ran ...
sudo nano /etc/apache2/sites-available/default-ssl
edited all ...well top 3 anyway
AllowOverride All

then ctrl+x to save and ... vagrant halt , vagrant up now it works ! strange ubantu https clean url issue just hopefully adding nice keywords for other mad Googlers that are trying not to cry.

Tim Banks’s picture

We are having the same problem with a Centos Cloud server.

mod_rewrite is on and the sites .htaccess is in place but as soon as you try to hit any page other than the home page the sites returns a 404 error screen.

The /etc/httpd/vhosts.d/default.conf file (equivalent to Ubuntus /etc/apache2/sites-available/default-ssl) has the following config for ssl running on port 443. (Replace site with the site name)

<VirtualHost *:443>
        SSLEngine on
    	SSLProtocol all -SSLv2 -SSLv3

	SSLHonorCipherOrder on

    	SSLCertificateFile /etc/httpd/ssl/site.crt
    	SSLCertificateKeyFile /etc/httpd/ssl/site.key
    	SSLCertificateChainFile /etc/httpd/ssl/class1-cert.crt
	SSLCACertificateFile /etc/httpd/ssl/cert.pem

        DocumentRoot /var/www/vhosts/site/www
        <Directory /var/www/vhosts/site/www>
		Options Indexes +FollowSymLinks MultiViews
        	AllowOverride None
        	Order allow,deny
        	allow from all
        </Directory>

	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    	<Directory "/usr/lib/cgi-bin">
        	AllowOverride None
        	Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        	Order allow,deny
        	Allow from all
    	</Directory>

    	ErrorLog /var/log/httpd/ssl_error_log

    	# Possible values include: debug, info, notice, warn, error, crit,
    	# alert, emerg.
    	LogLevel warn
        CustomLog /var/log/httpd/site-access.log combined

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
</VirtualHost>

Has anyone experienced similar?

fabrizior’s picture

It's been a long time since your post. I have the same problem. Have you solved it? Can you help me? Thank you.