Welcome Guest, Not a member yet? Register   Sign In
Simple Question
#1

[eluser]Ryann[/eluser]
i execute an
echo anchor('news/local/123', 'My News');

but the url seems to be
http://localhost/myci/index.php/news/local/123

how can i eliminate the index.php
http://localhost/myci/news/local/123
#2

[eluser]RogerM[/eluser]
Take a look in the CI user guide. Read all of it, most of your questions will be answered.

Removing the "Index.php"
#3

[eluser]Randy Casburn[/eluser]
That's not quite true RogerM...

You've got to get into the code a little to understand this one. If you're going to use the URL helper to build your links for you, please look into the code and try to understand what it is doing for you. Around line 125 of the url_helper.php file the <href> tag is built. Prior to that you'll notice it uses a function call to site_url() to gather up the what's needed to build the URL for the the tag. It get's a little tricky at that point, but here's the rub, eventually, it pulls whatever you have on the 'index_page' configuration parameter in the config.php configuration file and uses it. If it's blank, as it should be with the "Removing index.php" option, then index.php won't show up.

More than likely, it isn't blank.

Now, if you weren't lazy you could have figured that out on your own and actually learned a lot about CI in the process. That's how most of us learned this stuff. Try...it really works.

Randy
#4

[eluser]awpti[/eluser]
Is it your mission to be a dick at every opportunity?

RogerM's answer was right on the money. 100% correct and required no further commentary (especially the likes of which you just spewed out on the deck there).

Not everyone is interested in the core of CodeIgniter. The documentation covers everything you'll ever need to know as a general developer.

By the way, most of us learned this stuff by reading the docs, not digging through the core. I guess you learned PHP by reading through code that makes up the parsing engine, right?
#5

[eluser]fillipe.bs[/eluser]
Hello guys,

I'm brazillian, (sorry for bad english). I read the UserGuide but for some reason .htacess file is redirecting me to the localhost/xampp if I dont write index.php in URL.

The .htacess file that I'm using is this:
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

Any Ideas?
Thanks
#6

[eluser]Wondering Coder[/eluser]
i used this one
Code:
RewriteEngine on
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule (.*) index.php/$1 [L]
#7

[eluser]fillipe.bs[/eluser]
Thanks a lot Wondering Coder, that works.




Theme © iAndrew 2016 - Forum software by © MyBB