0

I have written URL rewrite condition in MY htaccess file to achieve below. But I have done all the permutation combination to achieve below results via .htaccess file.

White labeling

http://www.Mayday.com/login.html => http://23.24.25.26/login.html#/varFooMayday
http://www.Hayday.com/login.html => http://23.24.25.26/login.html#/varFooHayday

also varFooMayDay and varFooHayday are constant values And login.html should be actually be Implicitly login.html#/varFooHayday by using URL rewrite.

I need to write a condition for only achieving above.

RewriteCond %{HTTP_HOST} ^(www.)?mayday.com$
RewriteCond %{REQUEST_URI} !^/kgbadmin/kgb/QTT/view/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /kgbadmin/kgb/QTT/view/$1

RewriteCond %{HTTP_HOST} ^(www.)?mayday.com$
RewriteRule ^(/)?$ kgbadmin/kgb/QTT/view/index.html [L]

Pls can some one help me write this URL rewriter?

abksharma
  • 576
  • 7
  • 26

2 Answers2

0

You can have your rules like this:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(?:www\.)?(Mayday|Hayday)\.com$ [NC]
RewriteRule ^(login\.html)$ http://23.24.25.26/$1#/varFoo%1 [L,NE,R]

RewriteCond %{HTTP_HOST} ^(www.)?mayday.com$
RewriteCond %{REQUEST_URI} !^/kgbadmin/kgb/QTT/view/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /kgbadmin/kgb/QTT/view/$1 [L]

RewriteCond %{HTTP_HOST} ^(www.)?mayday\.com$
RewriteRule ^(/)?$ kgbadmin/kgb/QTT/view/index.html [L]
anubhava
  • 761,203
  • 64
  • 569
  • 643
-1

If you want to redirect to a different domain/address, you will need mod_proxy.

Flip Vernooij
  • 889
  • 6
  • 15