So I installed Codeigniter in a sub directory on my bluehost hosting account after testing it locally and everything working great! But now when I goto the subdirectory on bluehost I get taken to the right index page which is set in my routes as this:
$route['default_controller'] = "user";
So that works. But when I try to go to any other page for instance.."/user/reg_view". It gives me nothing but 404 errors. I've tried different things on the htaccess file and I've also tried changing the URI protocol in the config to AUTO and also REQUEST_URI but nothing works. It just always gives me a 404 error.. any thoughts or suggestions?
Thank you.
Related
I built and angular 8 app with a php backend ( 7.3 ). I am trying to launch my site on bluehost. I set up the database ( MySql ), set the password, username etc. I put my folders in the public_html folder. Index.html loads but throws up a 404 for the api. Additionally, when I nav to another page then refresh, I also get a 404 error. Folder structure looks like:
public_html/
( config.ini & htaccess & api_folder & index.html )
The spa_folder has the index.html
I tried a lot of solutions for the htaccess but nothing seems to be working. Whatever I try I get the 404 error on console for the API but the index page loads.
I'm just kinda stuck and not sure where to investigate for a solution. Any help or ideas would be great.
If anyone is wondering, my .htaccess paths were slightly off and the issue was corrected in the .htaccess.
I have issue regarding URL in Codeigniter on server.
Actually, Site was working before shared hosting server like http://example.com/login
But after change server dedicated and integrate SSL, the site not working inner pages. Like https://example.com/login where got below issue:
Not Found
The requested URL /login was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
But home page open https://example.com It might some issue related rewrite or else. I tried using .htaccess also but nothing changed.
Site page is open using add /index.php in between like https://example.com/index.php/login
Any one have idea or trick to sortout it.
Thanks
At the moment I am trying to move a website to a new web server. The site uses CodeIgniter and on the old server, every route worked. On the new server none of them are working, even though I copied the entire website from the old server. This means there are no differences in .htaccess files, since the two servers contain the exact same website. Not even the default routes are working, just the home page (index.php). I included the code in .htaccess to remove 'index.php' from routed URLs, but that also does not work.
If I try to visit '1.1.1.1/~user/employees' it will give me a 404 error, which means that the CodeIgniter route is not working. The controller file is located at /application/controllers/employees.php, so I am not sure what causes the problem.
I am aware of the similar posts on the site here, but none of them could solve my problem. Configuration of the config/config.php is (partly) as follows:
$config['base_url'] = '1.1.1.1/~user';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
I have tried to change the base_url, but it still does not work if it's empty. Changing uri_protocol to REQUEST_URI or PATH_INFO also does not work. Also, if I try 1.1.1.1/~user/index.php/employees (so put 'index.php/' in between) I still cannot reach the page. I checked some Apache settings as well, AllowOverride is set to ALL and the mod_rewrite module is installed and enabled. Is there perhaps something else concerning differences in both server's configurations that I could have missed?
EDIT:
I think I am a bit closer to finding out what the problem is. It is either something with Apache or .htaccess (but I already tried many things) or it has to do with the fact that the server URL is 1.1.1.1/~user rather than 2.2.2.2 as it was on the old server. Maybe I should change the baseurl or location of my .htaccess? This looks similar to my problem, but moving the .htaccess did not fix the problem: Url routing errors in php in codeigniter. I might try re-installing Apache.
I think that you firstly should find out what happened.
All requests to CI go through index.php, so you just echo something and exit in index.php file at the first line.
If the page display what you echoed that means there is something wrong in CI, otherwise that's not because of CI. And you can focus on what cause the problem.
Sorry about my English.
I am installing a site made in PHP/CodeIgniter 2 on a hosting server which unfortunately has IIS running, which I have no experience in.
Nothing is working except the homepage, all other pages are returning 404 errors.
Adding index.php to the url returns 500 - Internal server error (I have the index page config set to '' in the config.php file)
I tried also creating a web.config file thinking the issue might be from the redirects, but adding a web.config file stops even the homepage from working, even if the web.config file added is completely empty.
Help really appreciated.
Check if the hosting server has Re-write module installed in it, that could be your problem.
Make sure you had installed URL Rewrite -
http://www.iis.net/downloads/microsoft/url-rewrite
After you had installed the module you should able to see this icon (URL Rewrite) in your IIS Management.
I have a website that's running correctly, now to setup a beta environment I copied the whole structure into a subfolder. So instead of var/www I have var/www/beta/.
This worked on my old server but on my new one its throwing me the "Unable to resolve the request" error. I've changed all the rights and checked the linking of the files. The main page shows up correctly but when clicking a link that goes deeper into the site it gives me the 404 error.
When I set the default controller a link will work. When I try to go to that url myself it will not, I'm thinking something is up with my urlManager ? (So www.website.com/xx/yy/2 wont work but defaulController = 'xx/yy/2'; and go to www.website.com will show the page)
Any help / insight would be appreciated.
If you're using apache, you'll need to update your RewriteBase, like this:
in var/www/beta/.htaccess, add:
RewriteEngine On
RewriteBase /beta/
This should do it.