CodeIgniter Forums
Emergency need with URI - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Emergency need with URI (/showthread.php?tid=12831)



Emergency need with URI - El Forum - 11-01-2008

[eluser]mousavi[/eluser]
hi, I’m just starting to use CodeIgniter and I have a problem with segment based URLs.
It doesn’t work when I type my URI. Actually I get HTTP 404 error, even if my $config[‘enable_query_strings’] is set to FALSE in config.php. But when I set it to TRUE the URL works in query string manner.
what can I do? If anybody help, I will be thankful.


Emergency need with URI - El Forum - 11-01-2008

[eluser]davidbehler[/eluser]
Can you give as un example URL that's working/not working?
And tell us more about the config?


Emergency need with URI - El Forum - 11-02-2008

[eluser]mousavi[/eluser]
Thanks for your asnswer.

This is an example when my URI dont work and I get "HTTP 404 not found" (The page can not be found) in IE and "No Input File Specified" in Opera. Although $config['enable_query_strings'] is equal to FALSE in config.php file:
http://localhost/index.php/blog/index

But when I set this line to TRUE as $config['enable_query_strings'] = TRUE; my URL works with query string as if:
http://localhost/index.php?c=blog&m=index

But It is unusual using query string in CodeIgniter.


Emergency need with URI - El Forum - 11-02-2008

[eluser]Randy Casburn[/eluser]
Please ensure all paths are set correctly in your config/config.php file and if you are using .htaccess file either remove it for troubleshooting purposes to ensure that is not clouding the issue or rename it for now. var_dump($_SERVER) and find PATH_INFO or ORIG_PATH_INFO etc. to determine which to use in your config file. Perhaps that setting is not being picked up properly either.

These are the likely candidates.

Hope this helps,

Randy


Emergency need with URI - El Forum - 11-03-2008

[eluser]mousavi[/eluser]
I dont use .htaccess file. I just downloaded CI and did its installation instructions, set this line in config/config.php as:
$config['base_url'] = "http://localhost/";

I didnt do anything else except that instructions. But It didnt work either. I've also downloaded CI v.1.7.0 and installed it, but it didnt help. I'm wondering how I have just this problem both in my office pc and home. And nobody have ever mentioned this in this forum.

If this information could help, I would mention that my web server is apache 1.3.39 with Win XP. And my CI is in this path "D:\Program Files\Apache Group\Apache\htdocs\ci" and I set DocumentRoot in conf/httpd.conf file as this:

DocumentRoot "D:/Program Files/Apache Group/Apache/htdocs/ci/"

Actually all of my other URLs works, I have just that problem mentioned.


Emergency need with URI - El Forum - 11-03-2008

[eluser]Randy Casburn[/eluser]
[quote author="mousavi" date="1225725381"]I dont use .htaccess file. I just downloaded CI and did its installation instructions, set this line in config/config.php as:
$config['base_url'] = "http://localhost/";

I didnt do anything else except that instructions. [/quote]

If the quote above is COMPLETELY accurate, your problem statement is suspect about query strings vs. no query strings...

Since you say this url doesn't work: http://localhost/index.php/blog/index
But this url does: http://localhost/index.php?c=blog&m=index

We've not been exposed to the entire scenerio...and you're making this more difficult on yourself than you need to.

---

I say this because there is no blog controller installed with the base installation of either 1.6.3 or 1.7.0 or CI.

Why don't you try: http://localhost/index.php on a fresh install. If that works, then you've messed something up. Tell us what you did AFTER the install...not that you did a normal install.

---

Randy