My server (Apache 2x) is working properly with SSL certificate but I need to prevent only a single URL from accepting normal (HTTP only) connection.
The current structure looks like this (it's messed up, due to tests already done)
<VirtualHost *:80>
ServerName domain.com
ServerAlias www.domain.com
#Redirect permanent / https://domain.com/
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} on
#RewriteCond %{SERVER_NAME} =domain.com
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^/complemento/url [NC]
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
Redirect permanent / https://domain.com/
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin [email protected]
ServerName domain.com
ServerAlias www.domain.com
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /home/domain/domain.com.crt
SSLCertificateKeyFile /etc/apache2/ssl/domain.key
SSLCertificateChainFile /home/domain-bundle.crt
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
<Directory /var/www/html>
Options FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
</IfModule>
This way it does not work. How to proceed?