htaccess is not working |
[eluser]Blue Sapphire[/eluser]
Hi! I have used many codes [available in CI forums] as well as following code in Wiki Wiki Link for creation htaccess But nothing has run perfectly on my system. I have following configuration. Application URL : http://localhost/personal/dev/ci/ Web server : WAMP SERVER 2.0 Apache : 2.0.61 PHP : 5.2.5 Rewrite_Module : Enabled Made following changes in config file of CI : $config['index_page'] = ""; $config['uri_protocol'] = "REQUEST_URI"; Can some one give me perfect code or help me in modifying he WIKI code so that 'htaccess' can run on my local machine. Thanks in advance
[eluser]Clooner[/eluser]
It should work the either way. Which version did you try? Did you set in the htaccess file the rewritebase correct? Do you have mod_rewrite running?
[eluser]Zeeshan Rasool[/eluser]
Yar ! i think you have to check this code. Save it wirh .htaccess but remove ‘index.php’ from your config.php file Options +FollowSymLinks Options -Indexes DirectoryIndex index.php RewriteEngine on RewriteCond $1 !^(index\.php|resources|images|css|js|robots\.txt|favicon\.ico) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L,QSA] Hope you will get it. ...............JaMzEe
[eluser]Blue Sapphire[/eluser]
Thanks for guidance. I have checked through "phpinfo()". It is showing me that in "Loaded Modules", there exists "mod_rewrite". I have removed index.php and now it is like -> $config[’index_page’] = “”; But sill problem exists. Now I am getting "404 Page Not Found" error, [even typing index.php in the url]. My script location is : "http://localhost/personal/dev/ci/"
[eluser]Yash[/eluser]
Just back to normal first..Remove all changes you made. Now try to run site.If works then do just this make htaccess file save this code. Now Try ... Code: <IfModule mod_rewrite.c>
[eluser]Blue Sapphire[/eluser]
Thanks for the guidance. I rolled back the changes in config file. The script begin to work properly with 'index.php' inclusion. Then I placed following code in htaccess file. <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 [L] </IfModule> <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule> RESULTS: 1- http://localhost/personal/dev/ci/ [Works Fine] 2- http://localhost/personal/dev/ci/index.php [Works Fine] 3- http://localhost/personal/dev/ci/index.php/myform [Works Fine] 4- http://localhost/personal/dev/ci/myform [Takes back to default WAMP SERVER page] NOTE: I have created aliases in WAMP, so my script directory location is outside of WAMP 'WWW' directory. My directory location for this script is 'E:\personal\dev\ci', whereas WAMP SERVER location is 'c:/wamp/www/ ' . Thanks in advance
[eluser]Yash[/eluser]
Almost done.. Now copy your CI installation into "c:/wamp/www/" so you will have "c:/wamp/www/CI" Now edit config.php .set base_url to "http://localhost/CI" remove index.php [optional] it will work perfectly. if-> for WAMP you need everything in www folder. [GOOD Habit]... Else-> Research more... Enjoy ![]()
[eluser]Clooner[/eluser]
[quote author="Yash" date="1214487247"] if-> for WAMP you need everything in www folder. [GOOD Habit]... Else-> Research more... [/quote] Isn't it possible to define the entire path with rewritebase and leave it outside the www dir?
[eluser]Yash[/eluser]
I guess Answer is Yes but you should to be very good with rewritebase. I mean this is little advance so you should know what you are doing.
[eluser]hcvitto[/eluser]
hi i need to get "into" yor discussion because i got the same problem. Here's my conf: ( Summer Student quotes ![]() Application URL : http://127.0.0.1/CodeIgniter/ Web server : xampp server 1.6.6a Rewrite_Module : Enabled Made following changes in config file of CI : $config['base_url'] = "http://127.0.0.1/CodeIgniter/"; $config[’index_page’] = “”; This is my .htaccess file in C:\Programmi\xampp\htdocs\CodeIgniter <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 [L] </IfModule> <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule> And here are the results: 1- http://localhost/CodeIgniter/ [Works Fine] 2- http://localhost/CodeIgniter/index.php [Works Fine] 3- http://localhost/CodeIgniter/index.php/about/ [Works Fine] 4- http://localhost/CodeIgniter/about/ [Takes back to default xampp SERVER page] Any idea about that? Thank Vitto |
Welcome Guest, Not a member yet? Register Sign In |