php - Htaccess rewrite rule from repertory load sub domain urls -
i trying 2 website. main 1 on www.personal.com there wordpress blog hosted on server loaded on blog.personal.com
i want mask urls main site /blog/ architecture , load (with transparency) same sub domain urls
example : www.personal.com/blog/my-first-article load blog.personal.com/my-first-article keeping url in browser (the url in browser ne change) :
www.personal.com/blog/my-first-article
last difficulty, .htaccess file used others websites host, not want theses rules others domain personal.com rule should 1 domain name.
does know how to ?
solved, right thing was, in apache vhost configuration :
rewriteengine on rewritecond %{http_host} ^www\.personal\.com$ rewritecond %{request_uri} ^/blog/ rewriterule ^blog/(.*)$ http://blog.personal.com/$1 [p,qsa] proxypass /blog/ http://blog.personal.com/ rewritecond %{http_referer} ^http://www\.personal\.com/blog/ [nc] rewritecond %{request_uri} ^(/[^/]+/) rewritecond %{request_uri} \.(jpg|png|css|js)$ rewriterule ^(.*)$ http://blog.personal.com/$1 [l,qsa,r=301]
Comments
Post a Comment