0

How I can redirect

  • osite.com
  • en.osite.com
  • ru.osite.com/product/1

and other different subdomains respectively to

  • so.kr/index.php?url=site.com
  • so.kr/index.php?url=en.site.com
  • so.kr/index.php?url=ru.site.com/product/1

in Apache? This is need for convenient links shortening of site.com. Thank in advance.

4

1 回答 1

0

I don't understand it, but it work.

RewriteEngine on

RewriteCond %{HTTP_HOST} ^([\w\d]+)\.osite\.ru$
RewriteRule ^(.*)$ http://so.kr/index.php?url=http://%1.site.ru$1 [NC,L,QSA]
于 2016-06-21T08:33:03.307 回答