I've installed a CodeIgniter app on an OpenLiteSpeed server, and although the script installation went smoothly, there appears to be a problem with the .htaccess redirects.
Pages only seem to work when adding "index.php" at the beginning of the URL, such as https://app.example.com/index.php/admin. If I visit https://app.example.com/admin, the site breaks.
The contents of my .htaccess file is as follows:
<IfModule mod_rewrite.c>
RewriteEngine On
# RewriteBase could be necessary depending on your server setup
# RewriteBase /
# Add this to handle requests to your CodeIgniter front controller
RewriteCond %{REQUEST_URI} !^/(index\.php|assets|robots\.txt|favicon.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
# Existing rules
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !.(js|css|eot|svg|ttf|woff|woff2|map)$ index.php [L]
RewriteCond $1 !^(index\.php|assets)
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
# Redirect requests for favicon.ico to the actual file
Redirect 301 /favicon.ico /assets/images/favicon.ico
# Deny access to .env file
<Files .env>
Order allow,deny
Deny from all
</Files>
</IfModule>
Any help would be appreciated.
I tried editing the .htaccess file inline with any documentation I could find online pertaining to OpenLiteSpeed and redirects, but have had no joy so far.
.htaccessfiles are not enabled and/or mod_rewrite is not enabled. If you request/favicon.ico, are you externally redirected?.htaccesswas "working" then they should still be able to access the URL as stated in the question (withoutindex.php). Changing the URL format in CI simply instructs how CI generates URLs (not necessarily how CI interprets them) - which the OP will also need to do (but by the sounds of it they have already done this, since they can only get it to work by "adding "index.php" at the beginning of the URL").