Skip to content
Advertisement

CodeIgniter 4 Route url not found “The requested URL was not found on this server.” deployment on Heroku

Greetings I have a problem with my application in CodeIgniter 4, recently I moved all my websites to Heroku and for this website what is built in CodeIgniter 4 https://myconfessio.com/ only the index/home page look right but when I try to go to another page or do something else I get the error

Not Found The requested URL was not found on this server.

Why is this happening and how can I fix this?

Advertisement

Answer

I found some solution when I create .htaccess in a public folder and put this

RewriteEngine on

RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement