mydomain.com/dir/cgi-bin/mirror.cgi/http/www.test.com/
into
mydomain.com/www.test.com
mydomain.com/dir/cgi-bin/mirror.cgi/http/www.test.com/
into
mydomain.com/www.test.com
Try this rule in your .htaccess file:
RewriteRule ^www\.[^/]+$ /dir/cgi-bin/mirror.cgi/http/$0/
That will rewrite a request of /www.example.com
internally to /dir/cgi-bin/mirror.cgi/http/www.example.com/
.
In the .htaccess file:
ModRewrite On
RewriteRule (([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}) /dir/cgi-bin/mirror.cgi/http/$1/
Regex pulled from regexlib.com.
The first half defines a regular expression that matches valid domain names, and the second part is what it is redirected to (with $1
replaced by the matching domain).