CodeIgniter Forums
Myth/Auth problem on shared hosting - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Myth/Auth problem on shared hosting (/showthread.php?tid=78633)



Myth/Auth problem on shared hosting - biker64 - 02-18-2021

Trying to use Codeigniter with Myth/Auth on shared hosting so having to use domain.com/public as the url atm.
(I know its not the ideal setup but iIm stuck with if for now)

The routing to the login page works fine for domain.com/public/login but whenever I enter the credentials I then get sent to mydomain.com/login which gives am a page not found error.

Have I missed something obvious in configuring setting this up.  

Many thanks.


RE: Myth/Auth problem on shared hosting - biker64 - 02-19-2021

Ok, I think i worked it out

The view was using route_to('login') in the form action which was returning mydomain.com/login

I changed the following 

PHP Code:
<form action="<?= route_to('login') ?>" method="post"

to 

PHP Code:
<form action="<?= base_url(route_to('login')); ?>" method="post"

as suggested in https://forum.codeigniter.com/thread-76361-post-375546.html#pid375546 and that seems to have fixed it.