Welcome Guest, Not a member yet? Register   Sign In
Error while I open CodeIgniter index.php page without parameters
#11

[eluser]sholsinger[/eluser]
[quote author="wornjacket" date="1233699759"]Try this:


In your .htaccess file:

Comment out anything similar to:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt|user_guide)
RewriteRule ^(.*)$ /index.php/$1 [L]


Add:

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>

Save it, upload it, Refresh the page[/quote]

Parent has it right, I've found that the above mod_rewrite rule is more robust than the one supplied with CodeIgniter as a sample.
#12

[eluser]Colin Williams[/eluser]
Why would you rewrite requests to index.php?/$1 and not just index.php/$1

Seems like the former would only work if you used 'REQUEST_URI' and not 'PATH_INFO'

It's good to know the consequence of these particulars and get beyond being a copy-paste monkey.
#13

[eluser]sholsinger[/eluser]
[quote author="Colin Williams" date="1233721352"]Why would you rewrite requests to index.php?/$1 and not just index.php/$1[/quote]

Ah, yeah, good catch. Thats the only difference between what he and I use.
#14

[eluser]brandonrichards[/eluser]
@Colin I'm glad there is an ignore feature

@everyone else. Feel free to change, alter to suit your needs.
#15

[eluser]Colin Williams[/eluser]
@wornjacket, my remarks weren't made at anyone in particular, just the general culture of such behavior. If you disagree that, at some point in time, people need to understand the code they are using, then I guess that's fine. You can choose to ignore it all you want.




Theme © iAndrew 2016 - Forum software by © MyBB