Hi! I have created the following directive snippet for Apache and named it "Rewrite missing URLs to index.php": Code: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> but when I try to include it in my Apache vhost config, it isn't being included! The vhost configuration is saved with no errors, the update is handled asynchronously via the cronjob in about a minute, but the updated vhost config simply doesn't have this snippet in it! Is this a bug, or am I doing something wrong (like, perhaps only the variables listed under the textarea are allowed for some reason)?
This means that Apache rejected that file and refused to start with it, ISPconfig then rolled back the last working config to avoid Apache incl. all other sites and ISPConfig GUI becoming unreachable. You can rename the currently used vhost file to e.g vhost.bak, rename the vhost.err file to .vhost so that it is included in the config and then restart apache to see which error you get.
Thanks! Apparently, RewriteBase / is only valid in per-directory config files. EDIT: but also, for Apache 2.2.16 and above (so basically pretty much any Apache by now), this whole snippet can be replaced with a single line, which is so much prettier and even works much better: Code: FallbackResource /index.php The only caveat with this solution is that if index.php is missing in the root dir, you're now getting error 500 instead of 404. But it would have been that way with the initial snippet as well (additional RewriteCond line was needed to check if index.php actually exists). /EDIT By the way, Apache restart is not really necessary in such case, it's better to run apachectl configtest to see the errors. Since ISPConfig currently doesn't report these errors and ignores them silentely, may I suggest that it report them? Thank you for stayling here so late, by the way!
ISPConfig is using a config test anyway before attempting the restart or reload. But configtest is not reliable as it is not able to detect all config errors that makes apache fail, so a rollback in case or a restart failure is also needed. And before I explain you a detailed procedure using multiple commands here in the forum, its better you do a restart right away to test it. ISPConfig is reporting these errors in the system log in the monitor section as warnings, and depending on your chosen settings, you even get an email in this case automatically.