.htaccess - How to rewrite with wildcards in htaccess? -


how can rewrite this:

www.mydomain.com/directoryname/(wildcard) 

to this:

www.myotherdomain.com/directoryname/(wildcard) 

i have many subdirectories , files on "myotherdomain.com domain name, , need accessible via mydomain.com wildcard. assume need use htaccess achieve this, have not bee able figure out correct syntax.

try adding these rules htaccess file in document root of www.mydomain.com site:

rewriteengine on rewritecond %{http_host} ^(www\.)?mydomain\.com$ [nc] rewriterule ^directoryname/(.*)$ http://www.myotherdomain.com/directoryname/$1 [l,r] 

that redirect browser, means address in url changes. if don't want change, need have mod_proxy loaded, , change r p. if mod_proxy isn't loaded, p flag won't work.


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -