Forum Moderators: phranque
For eg:
I have domain called www.mydomain.com. I want to do 2 things.
* If the request URI is business (http://www.mydomain.com/business/*) i want to rewrite the request as [anotherhost:81...] (uri remain same but the host changes)
* if i get a request as [business.mydomain.com...] I want to rewrite the request as [anotherhost:81...] (uri remains same).
Any possible solution.
Thanks in advance.
Regards,
Avinash.
Welcome to WebmasterWorld [webmasterworld.com]!
In accordance with our charter [webmasterworld.com], we'll be happy to help you learn how to do this, or to help you get your own code working, but we can't write it for you. We would simply get too many requests, and this would leave you dependendent on WebmasterWorld for "support."
Here are some links to help get you started:
Apache mod_rewrite documentation [httpd.apache.org]
Apache URL Rewriting Guide [httpd.apache.org]
Regular Expressions Tutorial [etext.lib.virginia.edu]
You will need to use a RewriteCond to check the %{REQUEST_URI} for "/business" and a RewriteRule with a page-name back-reference to do the rewrite.
Jim