Sunday 15 September 2013

redirect - Apache mod_rewrite - rewriting from subdomain to main domain -


I want to redirect a url abc.xyz.com/123 to xyz.com. Therefore, the file that will be delivered will be xyz.com's index.php. That index. FPP should be available for both ABC and 123 (hence 123 $ _SERVER ['PHP_SELF'], and ABC will exit from $ _SERVER ['HTTP_HOST'] to enable appropriate processing.

< P> abc.xyz.com already goes to xyz.com (though by my service provider's configuration), and ABC can be removed from $ _SERVER ['HTTP_HOST'] However, abc.xyz.com/123xyz In the root directory of .com, a folder named 123 is looking for, and it is showing a 404 error. No one can get it.

Please give me a line to enter in .htaccess to enable abc.xyz.com/123 to call index.php of Xyz.com. ($ 123 with $ $ _SERVER ['PHP_SELF'] can be available? I do not think so

Maybe doing some work For example:

  Reviving OnRyRightCound% {HTTP_HOST} .xyz.com [NC] Rewritable ^ (. *) $ Index.php? Param = $ 1 [L, QSA]  

So, basically, if the HTTP host has .xyz.com (dot in front) The presence of this ensures that it is only for the subdomain), then whatever is being attached to the index.php, the domain is attached as $ $ _GET ['param'].


No comments:

Post a Comment