URL redirection to subdomain without changing URL in address -


i new linux , want use .htaccess or proxy url redirection leaving url unchanged apache2.

now want redirect main domain http://example.com/test subdomain http://test.example.com without changing url in address bar.

kindly me in giving me guidelines .htaccess or proxy or other..

if don't want url change either need reverse proxy set-up between 2 virtual hosts / domains, or if example.com alias, same ip , served same apache virtual host, use internal rewrite. more info here

your can try this. more infor go here

rewriteengine on rewritecond %{http_host} ^(www\.)?domain\.com$ [nc] rewriterule ^/?(index.\php)?$ /category [l] 

this works requests http://domain.com/ or http://domain.com/index.php, , you'd served content @ http://domain.com/category without changing url in address bar. can lose rewritecond %{http_host} ^(www\.)?domain\.com$ [nc] line if don't need it.

there helpful resource here

rewriteengine on  rewritebase /  ######## example.com ########  rewritecond %{http_host} ^.*example.com$ [nc]  rewritecond /www/quux-foo.com/www/root/v1%{request_uri} -d  rewriterule ^(.*[^/])$ %{request_filename}/ [l]  rewritecond %{http_host} ^.*quux-foo.com$ [nc]  rewritecond %{request_uri} ^/v1/  rewriterule ^(.*)$ - [f]  rewritecond %{http_host} ^.*example.com$ [nc]  rewritecond /www/quux-foo.com/www/root/v1%{request_uri} -f [or]  rewritecond /www/quux-foo.com/www/root/v1%{request_uri} -d  rewriterule ^(.*)$ v1/$1 [l]  rewritecond %{http_host} ^.*example.com$ [nc]  rewritecond %{request_uri} !^/v1/  rewriterule ^(.*)$ v1/index.php [l]  ######## example.com ######## 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -