apache - 301 redirect ?___store=default -


i need make 301 redirection urls have kind of ending in them:

?___store=default&___from_store=com

for example:

301 url

https://www.example.com/page.html?___store=default&___from_store=com

to:

https://www.example.com/page.html?___store=default_migrated&___from_store=com

server has apache in , magento 2 cms have running there. if more details needed i'm happy provide them.

you setup rewriterule in apache this. need check %{query_string} server variable see if matches query string "?___store=default&___from_store=com" (you can change bit less strict in matching regex if needed).

rewritecond %{query_string} ^___store=default&___from_store=com$ [nc] rewriterule ^(.*)$ https://www.example.com/$1?___store=default_migrated&___from_store=com [l,r=301] 

you can read more apache rewriterules here.


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -