I have a VPS on which I'm trying to setup multiple websites. For one of them, with the current set of rules (below), accessing
hxxp://example.com
sends me to
hxxp://www.example.com// [note the two //]
My httpd.conf looks like:
NameVirtualHost *:80
[other VirtualHosts]
<VirtualHost *:80>
ServerAlias www.example.com example.com
DocumentRoot /var/www/html/example.com
ServerName www.example.com
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
<directory /var/www/html/example.com>
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^([0-9]+)(.*)/?$ /showitem.php?j=$1 [NC]
</directory>
</VirtualHost>