Forum Moderators: phranque
I need to define URL Rewrite rules based on the domain names.
For example,
if the url is "http://www5.jp.com", I need to redirect it to "http://www5.jp.com/Chat/login.jsp"
and if the url is "http://www6.jp.com", I need to redirect it to "http://www6.jp.com/Messages/login.jsp"
How can I identify the domain name and write the Rewrite rule?
Thanks.
Best Regards,
JP.
The problem has been resolved.
The syntax is,
RewriteCond %{HTTP_HOST} ^www5.jp.com$
RewriteRule ^/$ [%{HTTP_HOST}...]
RewriteCond %{HTTP_HOST} ^www6.jp.com$
RewriteRule ^/$ [%{HTTP_HOST}...]
Thanks to www.widexl.com.
Best Regards,
JP.
RewriteCond %{HTTP_HOST} ^www5\.jp\.com$
RewriteRule ^/$ http://%{HTTP_HOST}/Chat/login.jsp [L]
#
RewriteCond %{HTTP_HOST} ^www6\.jp\.com$
RewriteRule ^/$ http://%{HTTP_HOST}/Messages/login.jsp [L]