user458753
user458753

Reputation: 147

Rewrite subdomain but keep url

I have a website at domain.com, it has a login page at domain.com/user/login. I would like login.domain.com to show the login but still have the url login.domain.com.

what i have now:

RewriteCond %{HTTP_HOST} ^login.domain.nl$ [NC]
RewriteRule (.*) http://domain.nl/user/login$1 [L]

but this changes the url as well and if i change it to:

RewriteCond %{HTTP_HOST} ^login.domain.nl$ [NC]
RewriteRule (.*) http://domain.nl/user/login$1 [P,L]

i get a 400..

what am i doing wrong?

Upvotes: 0

Views: 412

Answers (1)

arkin
arkin

Reputation: 21

This question is in the wrong seciton, however, you can't necessarily call the remote page like you want to (even using the proxy flag), you need to make a local reference.

You need to do something like:

RewriteCond %{HTTP_HOST} ^login.domain.nl$ [NC]
RewriteRule (.*) /user/login.php?arguments=$1 [QSA,L]

That references the local location of the file.

Upvotes: 2

Related Questions