My configuration in Apache VirtualHost file is:
<VirtualHost xxx.xxx.xxx.xxx:80>
ServerAdmin [email protected]
ServerName abcdefg.com
ServerAlias www.abcdefg.com
DocumentRoot /var/www/abcdefg.com/public/abcdefg/current/public/
ErrorLog /var/www/abcdefg.com/logs/error.log
CustomLog /var/www/abcdefg.com/logs/access.log combined
<Directory /var/www/abcdefg.com/public/abcdefg/current/public>
AllowOverride all
Options -MultiViews
</Directory>
<Location /blog>
PassengerEnabled off # turn off Passenger for /blog subdirectory
</Location>
<Location /support>
PassengerEnabled off # turn off Passenger for /support subdirectory
</Location>
<Location /stats>
PassengerEnabled off # turn off Passenger for /stats subdirectory
</Location>
RewriteEngine On
RewriteRule ^/blog/?(.*)$ /var/www/abcdefg.com/blog/public_html/$1 [NC,QSA,L]
RewriteRule ^/support/?(.*)$ /var/www/abcdefg.com/support/public_html/$1 [NC,QSA,L]
RewriteRule ^/stats/?(.*)$ /var/www/abcdefg.com/stats/public_html/$1 [NC,QSA,L]
RewriteCond %{HTTP_HOST} ^www\.abcdefg\.com [NC]
RewriteRule ^(.*)$ http://abcdefg.com/$1 [L,R=301]
</VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx:443>
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
ServerAdmin [email protected]
ServerName q1
DocumentRoot /var/www/abcdefg.com/public/abcdefg/current/public/
ErrorLog /var/www/abcdefg.com/logs/error.log
CustomLog /var/www/abcdefg.com/logs/access.log combined
</VirtualHost>
When I type www.abcdefg.com
, it results in http://abcdefg.com//
with the double slash at the back. How can I fix this?