Although being a decent web developer, I and most of my colleagues always struggle with basic tasks when using mod_rewrite.
I read the manuals and understood most of it, however most skills I've learned in life are by doing. The trouble is, there's no easy way to debug the configuration. Most of the time if I succeed at configuring the .htaccess
file it's by sheer random luck not by trial and error.
I realize one can read Apache error logs or pass rewriteRule results to GET parameters and present them in say, PHP files, but that's inconvenient and slow.
So, the question. Is there a tool for writing and debugging .htaccess
directives? Update: given that questions asking for libraries and similar are frequently closed as out of scope for SO, is there a more general technique for doing this?
Save the file and type the URL yoursite.com/foobar/ . If the reditect works and the URL gets redireted to the homepage of example.com then it's clear that your htaccess is working and being read by your Apache server. If it still doesn't work then the problem might be that your hosting provider has not enabled it.
First, visit https://htaccess.madewithlove.be. Then, enter your site's url and your . htaccess rewrite rule in the appropriate fields. Click Check Now.
RewriteBase is a useful server directive available for Apache web server that allows you to easily update numerous rewrite rules at one go.
You could use our htaccess tester. It allows you to test basic rewrite rules and conditions, we are trying to improve it's functionality over time but it does the job quite well with the current feature set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With