How to achieve http://(www.)domain.com.br/vi/{N}.htm redirect or rewrite to http://web.domain.com.br/vi/{N}.htm ? I try for very long time and not right effect
Edit: Looking for all other URI equal(!), how to redirect only URI like eg http://domain.com.br/vi/9975.htm Code (markup): to http://web.domain.com.br/vi/9975.htm Code (markup): Tried all these Redirect /abc2.html http://web.domain.com.br [R=301,L] RedirectMatch permanent ^/anything/(.*)$ http://web.domain.com.br/$1 RedirectMatch permanent ^/vi/(.*)$ http://web.domain.com.br/vi/$1 RedirectMatch permanent ^/vi/?([0-9]+)\.htm$ http://web.domain.com.br/vi/$ RewriteCond %{HTTP_HOST} ^www.domain.com.br/vi/$ [NC] RewriteRule ^(.*)$ http://web.domain.com.br/vi/$1 [R=301,L] Code (markup):
i think .htaccess file can easy to resolve the problem. the code: RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC] RewriteRule ^(.*)$ http://web.domain.com/$1 [R=301,L]
I too think that looks right. Hence trying this full set and reporting back how it goes while you may inspect www.montao.com.br/vi/{N}.htm still won't redirect to web...accordingly RewriteRule ^/vi/?([0-9]+)\.htm$ /Market/vi.do?id=$1 [PT,L] RewriteRule ^/li /Market/list.do [QSA,PT,L] RewriteRule ^/vi/locations.jsp /Market/locations.jsp [PT,L] Redirect /abc2.html http://web.montao.com.br [R=301,L] RedirectMatch permanent ^/anything/(.*)$ http://web.montao.com.br/$1 RedirectMatch permanent ^/vi/(.*)$ http://web.montao.com.br/vi/$1 RedirectMatch permanent ^/vi/?([0-9]+)\.htm$ http://web.montao.com.br/vi/$ RewriteCond %{HTTP_HOST} ^www.montao.com.br/vi/$ [NC] RewriteRule ^(.*)$ http://web.montao.com.br/vi/$1 [R=301,L] Code (markup):
All that is missing to catch is the dot. Hence my wonder if the whole wanted effect can be done with RedirectMatch only since nearly the same redirect is doable already ie http://montao.com.br/vi/asd Code (markup): redirects to http://web.montao.com.br/vi/asd Code (markup): according to RedirectMatch permanent ^/vi/(.*)$ http://web.montao.com.br/vi/$1 Code (markup): Now clearly what I want is http://montao.com.br/vi/{N}.htm Code (markup): redirects to http://web.montao.com.br/vi/{N].htm Code (markup): ie just add a subdomain to one dynamic uri. This should be easy or why not?
Solved @stackoverflow(stackoverflow.com/questions/3237061/how-mod-rewrite-can-add-subdomain) thanking you so much