0

For a client I am updating his website. One of the things I am having to do is remove the English part of the site (just keeping the Dutch part)

Since there are over 70 pages I do not want to do a redirect for every single page. I want to redirect every page that has ?lang=en in the title to the homepage.

Is this a good idea, and if so, any tips what I should write in the .htaccess?

Thanks!!

  • Maybe have a look at this question: http://stackoverflow.com/questions/871511/301-redirecting-urls-based-on-get-variables-in-htaccess – 0x6C77 Aug 18 '14 at 10:00
  • I'll look into that... If I understand correctly i will not be able to use a redirect, because Redirect only works with URL paths and not with the URL query. I will have to use a RewriteCond + RewriteRule and I will have to really get into that to understand wat it says and where I have to change things. But thanks for the info, gets a step further I think... – Joke Van de Fliert Aug 18 '14 at 13:44
  • Not tested: `RewriteCond %{QUERY_STRING} ^([^&]&)*lang=en(&|$) RewriteRule ^.*$ / [L,R=301]` – 0x6C77 Aug 18 '14 at 13:50
  • that gives an internal server error if I try to go to the site... Or could that be because I am testing local? THanks for your help btw :D – Joke Van de Fliert Aug 18 '14 at 14:07
  • Do you have `RewriteEngine On`? I have just tried it an it has worked for me, with a small tweak: `RewriteCond %{QUERY_STRING} ^([^&]&)*lang=en(&|$) RewriteRule ^.*$ /? [L,R=301]` – 0x6C77 Aug 18 '14 at 14:11
  • uhm no I didnt (cause I am an idiot... oops) But adding RewriteEngine On didn't help unfortunately... still an internal server error – Joke Van de Fliert Aug 18 '14 at 14:42

0 Answers0