Hi,
I install cPanel on a fresh server yestarday and noticed today that .htaccess don't appear to be working as it should.
When Password protect is being used, I need to put 'RewriteEngine off' above it, for it to work.
However this then breaks the Rewrite rules and they don't work.
I just write out the password protect and the URL Rewite works and tried with just the Password Protect in it from AuthType down.
But together they will not.
I have full root access to the server, and can't seem to work it out.
Here is the .htaccess.
The path to the .htaccess is /home/USERNAME/dev.DOMAIN.co.uk/.htaccess
I install cPanel on a fresh server yestarday and noticed today that .htaccess don't appear to be working as it should.
When Password protect is being used, I need to put 'RewriteEngine off' above it, for it to work.
However this then breaks the Rewrite rules and they don't work.
I just write out the password protect and the URL Rewite works and tried with just the Password Protect in it from AuthType down.
But together they will not.
I have full root access to the server, and can't seem to work it out.
Here is the .htaccess.
The path to the .htaccess is /home/USERNAME/dev.DOMAIN.co.uk/.htaccess
Code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
RewriteEngine off
AuthType Basic
AuthName "Dev Zone"
AuthUserFile "/home/USERNAME/.htpasswds/dev.DOMAIN.co.uk/passwd"
require valid-user
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php70” package as the default “PHP” programming language.
<IfModule mime_module>
AddType application/x-httpd-ea-php70 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
Last edited: