A
A
Alexander Teterevlev2017-08-09 06:34:01
Apache HTTP Server
Alexander Teterevlev, 2017-08-09 06:34:01

How to implement an internal redirect through htaccess without changing the address?

Hello! I have a problem of the following nature: I need to do an internal rewrite from city.mysite.com to mysite.com/?city=city. In this case, the address must remain city.mysite.com.
I wrote the following rules:
RewriteCond %{HTTP_HOST} !^www.mysite.ru$ [NC]
RewriteCond %{HTTP_HOST} ^(.+).mysite.ru$ [NC]
RewriteRule (.*) http://mysite. ru/$1?city=%1 [L,QSA]
and everything works, except for one little thing. The address is changing. Although I do not explicitly specify the R flag.
Tell me, what is my mistake?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question