apache2 - apache rewrite subdomain to domain with exceptions and variable -


i have example.com , x.example.com. want rewrite x.example.com example.com not redirect.

page.html real page. request example.com/page.html should page.html no url change. request x.example.com/page.html should same page.html andnot change url.

list programmed response. request example.com/list should rewrite example.com/index.php?q=list , appear user example.com/list. request x.example.com/list should rewrite example.com/index.php?a=x&q=list , appear user x.example.com/list. internally, index.php can choose present different data.

i starting following:

rewritecond %{request_filename} !-f   rewritecond %{request_filename} !-d   rewriterule ^ index.php [l] 

i found many examples rewriting www want rewrite after redirecting www. non www. www.x.example.com redirect permanently x.example.com x.example.com rewrite.

i need following handle https. request should maintain http/https across request:

rewriterule ^ - [e=protossl]   rewritecond %{https} on   rewriterule ^ - [e=protossl:s]   rewriterule ^ http%{env:protossl}://%1%{request_uri} [l,r=301] 


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -