Welcome Guest, Not a member yet? Register   Sign In
The index.php question, how to make this easier?
#1

[eluser]TWP Marketing[/eluser]
This is a perennial question on these forums, to the disgust of almost everyone. I have a suggestion about how to deal with it, but I want to see feedback from the community...l

First, because the index.php file WILL be read and used, whether it appears in the URL or not, why not remove the default requirement that it be included in the URL?

Second, as has been suggested before, add a configuration parameter which will place it in the url or not?

If someone can give valid reasons for requiring a url to contain '.../index.php/... I would really like to hear them.

Thanks
#2

[eluser]kanjimaster[/eluser]
As somebody who always removes (or more accurately hides) the index.php from my URLs, it would be hugely more convenient for me for it to be off by default. But there's a problem.

Whereas the existing default will work on every server that has PHP installed with no intervention, the proposed default will fail on some servers without extra configuration and won't work at all on those that simply don't have installed or enabled tools (e.g. the Apache mod_rewrite module) that support URL re-writing.

Therefore, with a sigh of regret, the current approach really is the most appropriate default.
#3

[eluser]TWP Marketing[/eluser]
Kanjimaster
Thanks for the reply. It seems to me that a check could be performed by CI on the server side to determine whether mod-rewrite was installed and enabled, and act accordingly based on the config var state. I haven't messed with server setup in years, but I have to think it is possible to check for all installed mods. Am I wrong here?
#4

[eluser]CroNiX[/eluser]
Problem is, htaccess gets read and acted upon the very first thing on every request, before php or CI gets ahold of the request. So it won't really do any good to have CI determine that because the app will be broken before that point if mod_rewrite is not enabled. The current approach is the most practical, and how others like wordpress do it. You simply can't rely on mod_rewrite being enabled, so you shouldn't set that as a default.

This is something that any decent developer should know and be able to figure out how to enable and manipulate and set up. Just because there are tons of noobs who don't know apache, php, CI, xhtml, css, javascript and lord knows what else on the forums doesn't mean we should dumb the framework down for their sakes. Let them figure out the basics first.
#5

[eluser]TWP Marketing[/eluser]
@CroNiX
I understand your position, although my opinion differs on how to new devs should be treated...
Because, as you correctly imply, the developer must know whether the intended server has mod-rewrite installed. It makes sense (to me) to provide a definitive, detailed explanation in the documentation, of the correct use of .htaccess to remove index.php from the url (yes, it is "hiding" it by re-writing the url).

But in fact it's not explained in enough detail in CI's docs. This is the root of the problem ON THESE FORUMS. That is why this question keeps coming up and triggering negative feedback to those who simply need a good explanation of the solution. It is not helpful to tell someone they are "in-experienced" and need to study harder. That may be true, but it doesn't help.

I've been following the CI docs (User Guide) for version 3.0 and I don't see this addressed yet, in the degree of detail needed. Yes, it's a work-in-process, so I'm stating my concerns now, in hopes that a fully detailed solution will be included with the release. What would it take, a page in the User Guide addressing .htaccess configuration? So what if it is redundant and can be found in the server docs. It needs to be part of CI's docs.
#6

[eluser]CroNiX[/eluser]
I'm trying to picture how big of a complex doc that would end up being considering everybody's environment most likely differs somewhat? It seems a lot of questions on these forums are already answered in the user guide, yet many don't read it before asking for help. Some servers require a ? after index.php in the rewrite to work with CI, others that will break, etc. What about documenting followsymlinks/rewritebase/allowoverride, etc? It goes far beyond just having mod_rewrite enabled. Others like Godaddy have certain requirements that aren't standard. It also has to do with the rest of the apache setup, which the developer must know and understand if they want to manipulate it or get something working within their particular setup. I'm just not sure that CI should be a resource for people learning about apache, or how CI could adequately write docs to cover all scenarios for people who basically don't know what they're doing. There's also the compounding issue of running behind a server that isn't Apache, such as IIS, Litespeed, Lighttpd, Nginx, etc, which may or may not use "htaccess" or even have slightly different implementations.

I don't really think CI is a framework for "new devs". It's more of a framework for "devs who know php/apache/mysql" and are ready to move on to a framework to become more efficient, but it shouldn't really be a starting point. I have no problem helping people with specific CI-related things, but if they obviously don't know basic php to begin with and is the reason why they are struggling, I look at that like someone who hopped into a car and tried to drive without ever learning how to do it first. There will most likely be big problems.

I also understand your position, but for me personally, I believe that CI isn't really a framework for people who don't know these basic development topics. Sure they can learn, but those subjects have their own quite large forums and millions of examples/tutorials already covering them out there on the net as they are common problems that don't really have a thing to do with CI directly.




Theme © iAndrew 2016 - Forum software by © MyBB