I cannot install Contao because the URL is being rewritten.

This happens if the local configuration file is not writable. You should activate the Safe Mode Hack to allow file operations via FTP. Add the following lines to the local configuration file system/config/localconfig.php: