Forum Moderators: phranque
I need to redirect this type of links
www.mysite.it/ext/www.externalsites.it/etc-etc
to
http://www.externalsites.it/etc-etc
This RedirectMatch doesn't work
RedirectMatch ^ext/(.*)$ http://$1 [L] Can you help me?
Tnx
[edited by: jdMorgan at 5:22 pm (utc) on Feb. 8, 2006]
[edit reason] De-linked. [/edit]
Welcome to WebmasterWorld!
The RedirectMatch directive does not use the [L] flag, so that is a syntax error.
RedirectMatch ^/ext/(.*)$ http://$1
Jim
Now it works, and I've improved the code
RedirectMatch ^/(http\://)?(www\..*)$ http://$2
RedirectMatch ^/(http\://)(.*)$ http://$2
By this code Apache send
http://www.mysite.com/http://www.domain.com or
http://www.mysite.com/www.domain.com or
http://www.mysite.com/http://domain.com
to the external url.
Do you think the syntax is good?
Sorry, my English is bad.
Mario.
And if the external domain doesn't begin with www, the redirect will not work.
(example: a virtual subdomain [sub.domain.com)...]
I've written this redirects
RedirectMatch ^/(http\://)?(www\..+)$ [$2...]
RedirectMatch ^/(http\://)(.+)$ [$2...]
:)
- Edit -
I can't remove the links!
Indirizzo non trovato.
Firefox non riesce a contattare il server www.index.php.
"Url not found.
Firefox can't contact the server www.index.php"
I don't look for a redirect of all the pages, but only of the link written in the format
[mysite.com...] similar)
Anyway my code works fine
shall be redirected to
http:// www. sub.site.com
check this two addresses
[posizionamento.minidesign.it...]
[posizionamento.minidesign.it...]
The first one doesn't work! For this reason I must specify two different rules.
Probably my 2-line solution is necessary. What do you think?
Thanks for the discussion. ^_^