Help, I got a problem, need help! |
[eluser]pangeran.zuko[/eluser]
Hi, everyone! I am Kukuh, I am actually new on CI, and have a problem... Here is: 1. I have downloading a new release of CI (1.7.1) 2. I also downloading and install XAMPP (http://www.apachefriends.org/en/xampp-windows.html) ver 1.7.0 which have following packets: Apache 2.2.11, PHP 5.2.8, and MySQL 5.1.30 3. In a brief, I am install CI in the C:/xampp/htdocs/myci which C:/xampp/ is the installed directory of CI and C:/xampp/htdocs/ is the web root public directory of xampp 4. Like the docs said, I config the /application/config/config.php file like this: $config['base_url'] = "http://localhost/myci/"; 5. Because I dont want the "index.php" included in my URL, so I entry the config $config['index_page'] with blank value. 6. I have read that if I have a blank entry for index_page config, I definitely have a .htaccess file. So, here is my rules wrote in my .htaccess file (I took the rewrite rules from the CI docs): RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L] 7. And here is my problem: every time I point to "http://localhost/myci", I always redirected to the "http://localhost/xampp" which is the homepage of xampp What's wrong? And how do I fix it? My goal is have a site that have no "index.php" included in its URL, so I have "http://localhost/myci/my_controllers", NOT the "http://localhost/myci/index.php/my_controllers".. which is work properly without redirected to the "http://localhost/xampp/".. Btw, since I'm not a native speaker, please forgive my bad English.. Thank you before and after to you guys!
[eluser]tomcode[/eluser]
Hi pangeran.zuko, Welcome on board. I always install my CI apps first without .htaccess and index.php in the address. Once I am up and running I take care of the clean URL's. This said, can You reach Your CI installation without .htaccess ?
[eluser]pangeran.zuko[/eluser]
oh yes, sorry for not giving you this info.. Yes! Without .htaccess and "index.php" as an entry for index_page, my local site is running well ! It say hello to me, which is called from welcome.php controller and welcome_message.php view, isn't right? So.. what's wrong?
[eluser]tomcode[/eluser]
I do not know Your flavour of .htaccess, but maybe You need to set the RewriteBase Quote:RewriteBase /myci Here's what I am using, I set the path /myci for Your installation : Quote:# The if clause does not work on all servers
[eluser]pangeran.zuko[/eluser]
[quote author="tomcode" date="1236671957"]I do not know Your flavour of .htaccess, but maybe You need to set the RewriteBase Quote:RewriteBase /myci[/quote] Ok, I will try your rules I'll post the progress soon [quote author="tomcode" date="1236671957"] Here's what I am using, I set the path /myci for Your installation : Quote:# The if clause does not work on all servers[/quote] Sorry, but, how & where do I write these codes? I've never seen these codes style before... in the .htaccess file?
[eluser]tomcode[/eluser]
This is a copy and paste example of the .htaccess file for Your installation ... You'll find it surely anywhere on CI's wiki, I use it since I am working with CI. With the time I recommend You to read http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html, this can really help out to counterfight some server constellations. You can also read the httpd.conf file of Your XAMPP installation, it uses the same syntax and allows You to do some nice stuff, too. Make copies before You change something !
[eluser]tomcode[/eluser]
Bt the way, You did put the .htaccess file into the folder with Your CI installation and NOT in the web root ?
[eluser]pangeran.zuko[/eluser]
[quote author="tomcode" date="1236672997"]This is a copy and paste example of the .htaccess file for Your installation ... You'll find it surely anywhere on CI's wiki, I use it since I am working with CI. With the time I recommend You to read http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html, this can really help out to counterfight some server constellations. You can also read the httpd.conf file of Your XAMPP installation, it uses the same syntax and allows You to do some nice stuff, too. Make copies before You change something ![/quote] Wow, thx for your info! Nice! I'll mastered it soon.
[eluser]pangeran.zuko[/eluser]
[quote author="tomcode" date="1236673676"]Bt the way, You did put the .htaccess file into the folder with Your CI installation and NOT in the web root ?[/quote] I did put the .htaccess file in the C:/xampp/htdocs/myci folder, where the C:/xampp/htdocs/myci/system folder is the CI's system Am I doing some mistake?
|
Welcome Guest, Not a member yet? Register Sign In |