I want to redirect to different domain, 83answers.com
if url contains forum
string.
Like if my url is test.guru99.com/forum/xyxyxzz
then it should redirect to 83answers.com
. String forum can be anywhere in the url.
I have tried following
RewriteCond %{QUERY_STRING} forum
RewriteRule .* 83answers.com [R,L]
and also this
RewriteCond %{REQUEST_URI} forum
RewriteRule .* 83answers.com
But both didn't work ,Please help me to sort this out.
Regards
You can add an OR clause between two RewriteCond like this:
For the base URL, you don't need
RewriteCond
, justRewriteRule
:For the query string, you were almost there:
The combined rules:
Note that you must include
http://
. If you just use83answers.com
, the server tries to redirect to a URL on your server. For example, it would redirecthttp://test.guru99.com/forum/xyxyxzz
tohttp://test.guru99.com/83answers.com
, which is no good.Real answer that i maded code is
in place of string yoou can put your word