Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't manage without index.php #541

Closed
MarlonJD opened this issue Jun 7, 2017 · 12 comments
Closed

Couldn't manage without index.php #541

MarlonJD opened this issue Jun 7, 2017 · 12 comments

Comments

@MarlonJD
Copy link

MarlonJD commented Jun 7, 2017

I'm using CI3 without index.php suffix but I couldn't manage this link style like sitename.com/controller-name/function . How can I do this in CI4. I couldn't found working reply. If this topic is forbidden or something like that. please inform me.

@InsiteFX
Copy link
Contributor

InsiteFX commented Jun 8, 2017

This is for CI 4 not CI 3, You need to go to the CI 3 Issues...

@MarlonJD
Copy link
Author

MarlonJD commented Jun 8, 2017

No. issue in on CI4. İ mean i cannot found solution for this issue for ci4.

@timothymarois
Copy link
Contributor

@MarlonJD Are you using apache and .htaccess for the mod_rewrite? By default CI4 is designed for that link style already. example.com/controller/method, but that is of course depending on your routing settings. But I dont know your setup, by default CI4 shouldn't require index.php to be within the url structure.

@MarlonJD
Copy link
Author

MarlonJD commented Jun 8, 2017

Yes there is CI3 projects on my local lamp stack and these are working. But in CI4 i can only access like http://localhost/public/index.php/home otherwise localhost/public/home is not working.

@timothymarois
Copy link
Contributor

timothymarois commented Jun 8, 2017

Side note, You need to point your domain to the /public directory, that is a change with CI4 as well. This way /public is not in the address of the website. What do you get when trying to access localhost/public/home ?

@MarlonJD
Copy link
Author

MarlonJD commented Jun 8, 2017

İt's redirecting to localhost/home
but without public it's not working. So how can i do this in locally, with htaccess?

@timothymarois
Copy link
Contributor

Are you using apache on your local machine?

@MarlonJD
Copy link
Author

MarlonJD commented Jun 8, 2017

Yes im using apache on arch linux

@timothymarois
Copy link
Contributor

And you have /public/.htaccess ?

@MarlonJD
Copy link
Author

MarlonJD commented Jun 8, 2017

Yes there is

@jim-parry
Copy link
Contributor

Move this to the forum, please. We use github for bug tracking and approved work packages.
Configure your virtul hist or aache so that the public folder in your project is the document root. See the repo readme!

@timothymarois
Copy link
Contributor

@MarlonJD - I'll just drop one last note here. Inside application/config/App.php you can set public $indexPage = 'index.php' to blank public $indexPage = ''; I usually don't change this, but if using mod_rewrite you can set this to blank so that it doesn't use this within the url structure, though I'm unsure how your app is configured. Just be sure apache mod_rewrite is enabled, and follow the CI 4 docs for more information. And yes, this issue should be dealt with using the forums or even stackoverflow for more feedback. https://bcit-ci.github.io/CodeIgniter4/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants