How to redirect from the page:

mydomen.ru/subfolder1/subfolder2/zamena-displeja?width=500&height=280&inline=true 

To the page:

 mydomen.ru/subfolder1/subfolder2/zamena-displeja 
  • Redirect /subfolder1/subfolder2/zamena-displeja?width=500&height=280&inline=true http://mydomen.ru/subfolder1/subfolder2/zamena-displeja - mymedia
  • not so sure does not work. here het parameters - miraghyk
  • Well then try this: <If "%{QUERY_STRING} == '?width=500&height=280&inline=true'"> Redirect /subfolder1/subfolder2 /subfolder1/subfolder2/zamena-displeja </If> - mymedia
  • But in general, you would have used such questions. Here, for example, they also try to remove the extra GET parameters from the request. - mymedia

1 answer 1

Use the PHP function:

 function md_redirect(){ $domain = 'https://mobidevices.ru'; if('https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] !== $domain.$_SERVER['REQUEST_URI']) { header('Location: '.$domain.$_SERVER['REQUEST_URI'],true,301); exit; } } 

It compares the page link with the link in the address bar and if it does not match it, then redirect to the normal address.