I have the following rewrite rule in apache conf.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^([^\.]+\.[^\.]+)$
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
It redirects http://example.org/?p=18 to http://www.example.org//?p=18. It adds // at the end of domain name. How to fix this?
You have an extra
/. You have two choices:You can avoid putting it in the target:
Or you can avoid capturing it in the match part: