Welcome Guest, Not a member yet? Register   Sign In
is the port number screwing things up?
#1

(This post was last modified: 11-11-2021, 05:54 PM by richb201.)

when someone first enters my site with staging.researchstudyonline.com, they immediately go to the wordpress landing page. There is a button on it to enter my php app. It is setup at staging.researchstudyonline.com:8181. So anything with port 8181 goes to my CI3 app.  

I am experiencing some strange situation. I developed my code under docker on my laptop and it did not use port 8181. It was running fine. So I moved it up to AWS and now I am experiencing some strange stuff. 
On my dashboard I have an enter button which has this link
<a href="campaign_management_with_actions" text-align: right;">Enter  </a> <br>
When I press the Enter link it goes to

 
PHP Code:
http://staging.researchstudyonline.com:8181/campaign_management_with_actions 

and this page is not found (404 error). 
BTW, I have set $config['base_url'] = 'http://staging.researchstudyonline.com:8181/'; in config.php
But if I remember correctly the URL created should  have been: 
PHP Code:
http://staging.researchstudyonline.com:8181/index.php/Configure/campaign_management_with_actions 

This is the way it was supposed to work, right? Or am I just having a senior moment?
Is it possible that the :8181 is screwing things up? 

Has anyone successfully used a port number as part of the routing?
proof that an old dog can learn new tricks
Reply
#2

The port number would not be the same on a live server, if they used one most do not.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(This post was last modified: 11-12-2021, 11:29 AM by richb201.)

"they" are not using a port number, I am using the port number. Actually, the guy I hired to set up my staging server is using ports. My theory is that this route would work
PHP Code:
http://staging.researchstudyonline.com/index.php/Configure/campaign_management_with_actions 
but that this route would not
PHP Code:
http://staging.researchstudyonline.com:8181/campaign_management_with_actions 
I have a debugger running on the system. Is it possible for me to step through the routing logic of the CI3 code to see if the route is actually getting mangled?

I have this is my routes. Is this incorrect?
$route['default_controller'] = 'Configure';

I'd like to be sure that the port is the problem before I go through the trouble of changing it. What module handles the CI3 routing before it gets to my application code?
proof that an old dog can learn new tricks
Reply
#4

(11-11-2021, 04:29 PM)richb201 Wrote: Has anyone successfully used a port number as part of the routing?

Yes, I use port 8888 on my computer and it works. I don't think your problem is the port in your config file.
Here is what I have in my .env file:
Code:
app.baseURL = 'http://ci4.test:8888'
app.indexPage = '';
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply
#5

(This post was last modified: 11-13-2021, 10:20 AM by richb201.)

Beer, what is the index Page about? Interesting that you keep the url hidden in a .env file! 

The routing is not working and I have no clue why? Is there any place I could put a breakpoint to debug this?
proof that an old dog can learn new tricks
Reply
#6

(11-13-2021, 10:09 AM)richb201 Wrote: Beer, what is the index Page about? Interesting that you keep the url hidden in a .env file! 

It's to remove the index.php from the url. I prefer to set the url and database credentials in the .env file since they are different in all environments (localhost vs. live site).

(11-13-2021, 10:09 AM)richb201 Wrote: The routing is not working and I have no clue why? Is there any place I could put a breakpoint to debug this?

I don't where exactly. You could always start from the index.php and step into everything to see where it's going. Wink
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply
#7

Hey Beer. In index.php I call a function which displays the dashboard. I can see that. But does index.php run every time? Is there a place that only runs one time? If so I would put the function that displays the the dashboard in there.
proof that an old dog can learn new tricks
Reply
#8

index.php is the front controller. Everything pass through that.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply




Theme © iAndrew 2016 - Forum software by © MyBB