php - mod rewrite rule for searching a string from url and replace just domain name of that url -


i want create rewrite rule .htaccess. example: in url if itemid=702 found want redirect below

original url is:

www.dashboard.example.com/comp/temp/health/appt?itemid=702 

redirect to:

www.admin.example.com/comp/temp/health/appt?itemid=702 

i have tried below condition, doesn't work.

rewritecond %{request_uri} itemid=702$ rewriterule .* http://admin.example.com [r,l] 

how can create this?

you're close, change rule to:

rewritecond %{query_string} itemid=702 [nc] rewriterule (.*) http://admin.example.com/$1 [r,l] 

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -