Apache: Writing and debugging RewriteRules

Yesterday I had to improve RewriteRules. We redirected the old Magento 1 /catalogsearch/ search urls to the homepage. Yesterday the penny dropped and we decided to redirect it to the Shopware search ?

How to do this you asked?

RewriteCond %{QUERY_STRING} q=(.+)
RewriteRule ^catalogsearch /search?search=%1 [L,R=301]

But more important to me is, how to implement this. Stackoverflow helps, the documentation from Apache HTTP Server Project but putting everything together in my own .htaccess or better VHost config I used

https://htaccess.madewithlove.com

They have other great tools, but unfortunately there seems to be no list?

But I can recommend https://semver.madewithlove.com as well, if you have problems with your expected composer packages!

2 thoughts on “Apache: Writing and debugging RewriteRules

  1. Hi Fabian, thanks for all the articles you are putting out – I love it!

    I did a little bit of digging regarding madewithlove, and I also did not find a listing of their tools. Looking at their GitHub profile and pages indexed by Google, I found https://coffeeroulette.madewithlove.com/ in addition to your links. I guess(?) this Slack app was not created by them, but that’s another nice tool they wrote about!

Leave a Reply