CodeIgniter Forums

Full Version: CI Newbie - localhost + URL issues
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
hope someone can help or guide me in the right direction. I am pretty new to CI Framework have started a contract job on a website that is developed in CI. I have all the code on my Mac and have everything up and running - I can see the homepage of he website on my local machine but cannot view any other URL of the website.

For example this url brings me to the homepage:

http://localhost:8888/<myproject>

And this URL should bring me to a static privacy.php page but all i get is 404 Error (The requested URL /index.php was not found on this server.)

http://localhost:8888/<myproject>/staticpage/privacy

The privacy.php file is in the folder views/static/privacy.php and has a staticpage.php controller also

I have downloaded the code from the production server and everything works fine on live site...Prob something really simple so hope someone can send me in the right direction

El Forum

[eluser]Unknown[/eluser]
Hi all, I'm having this exact same issue but the above solution didn't work... my index page on local works, but all other pages give me the 404. Everything on live server is working. On local, I have a vhosts.conf file with the following:

Code:
Alias /<myproject> /Server/sites/<myproject>/web/content

<Directory "/Server/sites/<myproject>/web/content">
Options Indexes FollowSymLinks

AllowOverride All

Order allow,deny
Allow from all
</Directory>

and my .htaccess is the following:

Code:
Options +FollowSymLinks

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]

RewriteRule ^(.*)$ /index.php/$1

If I print my $config['base_url'] value it is the following:

http://localhost/<myproject>/

Any help is greatly appreciated!

El Forum

[eluser]CroNiX[/eluser]
Why don't you guys just set up a virtual server for each project so you don't need to include the "subdirectory" that CI is installed in? It avoids all of these problems and when you move your project, you only have to update one config item (base_url) instead of config, htaccess, html templates, etc. Sure makes things simple. You just make the document_root whatever directory you have CI installed in (subdirectory).