Welcome Guest, Not a member yet? Register   Sign In
New to CodeIgniter... got a simple question
#1

[eluser]AdobeDelight[/eluser]
Hello,

I saw the video tutorial about how to use this PHP Framework and I instantly fell in love with this script. I wanted to start using it straight away, so i downloaded it and placed it in my web server on Windows OS, running XAMPP Suite.

When i entered this in my browser:

http://localhost/myApp

I saw the welcome message. According to the tutorial, If i typed this into the browser:

http://localhost/myApp/welcome

I should see the same welcome page right? Well, on my web server, it is giving me 404 file/folder not found error.

Why isn't it working? Im new to CI, so i would much appreciate it if someone would help me get this working. Thanks.
#2

[eluser]schnoodles[/eluser]
Im guessing you might not have index.php turned off aswell as using Apache.

Try http://localhost/myApp/index.php/welcome
#3

[eluser]AdobeDelight[/eluser]
Oh god, it works. Thanks allot for that, but im concerned about having to put index.php then the view file name.

What do u mean by this?

Quote:Im guessing you might not have index.php turned off aswell as using Apache.
#4

[eluser]schnoodles[/eluser]
OK read through http://ellislab.com/codeigniter/user-gui.../urls.html, it tells you how you can strip index.php with a codeigniter config setting and some apache.
#5

[eluser]AdobeDelight[/eluser]
Oh okay. Well, i put a .htaccess with the following in code in it:

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

And the i visited the browser like this: http://localhost/myApp/welcome

I got a "Server error!", error code 500 =/
#6

[eluser]schnoodles[/eluser]
Make sure in config.php you also do $config['index_page'] = ""; so it knows not to use index.php
#7

[eluser]AdobeDelight[/eluser]
I tried that, and no it didnt help Sad
#8

[eluser]efx[/eluser]
Hey, try taking the forward-slash off the front of the last line in your .htaccess
eg: RewriteRule ^(.*)$ index.php/$1 [L]

It's trying to redirect to index.php in your root directory, but you have everything up one level in your MyApp dir.

Hopefully that will fix it Smile




Theme © iAndrew 2016 - Forum software by © MyBB