I migrated a site built in codeigniter today that was previously working and now that it is on its new server, the site has issues. Specifically, the main page loads with AND without www at the front of the URL. When clicking to other pages, if they do not have ‘www’, I get the following error:
“Not Found: The requested URL /services was not found on this server.”
If I modify the URL to include ‘www’, the page loads.
Reminder: this was working before the migration, so I feel it is a server configuration issue.
Server: CentOS 8
2
Answers
As I guessed, this was a server configuration issue. I'm not entirely sure how the home page was loading, but I needed to add the following to my vhost records.
*There was also a routing issue at play. I used my hosts file to point the domain to the new server, however, the actual dns for the domain had an entry for www, so when I would type www, it was loading the live site.
I recommend that you include the htaccess file in your project root directory and paste the following code into the htaccess file..
I hope now your project should work fine.