Skip to main content
9 events
when toggle format what by license comment
Aug 22, 2017 at 12:21 comment added MrWhite It may be preferable to just make an exception for the /product/ URL, as mentioned in the last part of my answer (if you do this, then you don't remove the directory check and nor would you need to rewrite /product/documentation/). Otherwise, you'll need to make another exception for the /wp-admin URL, like you have done for your /product/documentation/ URL and manually rewrite to the document index (in this case index.php, not index.html). eg. RewriteRule ^wp-admin/?$ /wp-admin/index.php [L] (which needs to go before the WP front controller).
Aug 22, 2017 at 12:11 comment added Johannes Dorn I've noticed a problem. When commenting out the line RewriteCond %{REQUEST_FILENAME} !-d, this breaks the wp-admin URL www.example.org/wp-admin/. I am getting a ERR_TOO_MANY_REDIRECTS error. This does not affect sub URLs like www.example.org/wp-admin/edit.php.
Aug 22, 2017 at 5:55 vote accept Johannes Dorn
Aug 21, 2017 at 16:32 comment added MrWhite This alone shouldn't result in a "security risk". Requests for directories will now be routed through WP (assuming that is how you've chosen to do it), which will likely result in a 404, rather than a 403 (Apache default assuming directory indexes are not enabled) or 200 OK and an empty response - which is often the default behaviour with WP (if you have a blank index document in that directory).
Aug 21, 2017 at 16:29 comment added MrWhite You should only need to add that RewriteRule if you have removed the directory check in the WordPress front controller (however, the trailing ? on the regex should be omitted if the URLs should have a trailing slash - as in your question). I've updated my answer. However, if you used the "alternative" method in the last part of my answer, that shouldn't be required. (?)
Aug 21, 2017 at 15:27 history edited MrWhite CC BY-SA 3.0
Update with respect to comments.
Aug 21, 2017 at 11:13 comment added Johannes Dorn Thanks. This seems to work. However, I had to to change the last RewriteRule to RewriteRule ^product/documentation/?$ /product/documentation/index.html [L]. Can you update your answer? I would also like to know if there is some caveat to this approach beyond the necessity of manual updates to the .htaccess file? Is there some security risk?
Aug 18, 2017 at 20:45 history edited MrWhite CC BY-SA 3.0
deleted 10 characters in body
Aug 18, 2017 at 20:38 history answered MrWhite CC BY-SA 3.0