about user friendly url configuration in url on local web server.

#1
[eluser]hardik[/eluser]
hi,
i m using windows xp and xampp for my local system. and i m having trouble configuring user friendly url in codeigniter.

i installed the codeigniter and i checked everything it worked fine. i created ci folder in web root of my server. so i can access it using
Code:
http://server/ci/

i created other controller helloworld for just checked and run using this.
Code:
http://server/ci/index.php/helloworld
and it worked like a charm.

but then i thought making it userfriendly would be better i wanted to make it like
Code:
http://server/ci/helloworld
so i from user guide i found this code.

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

and put it in the ci directory where codeigniter is installed and then i set base url
from config file to

Code:
$config['base_url'] = "http://server/ci/";
$config['index_page'] = "";

and then i try to run
Code:
http://server/ci/helloworld
but i got Error 404 from apache.

i try to change directory of htaccess to system directory of codeigniter. so i put htaccess file into root>ci>system but still it did not work.

i try to check weather mod_rewrite is enabled or not but it also enabled and working in other site. i believe i am missing something to be configure. so can anyone help me with the issue ?

#2
[eluser]rogierb[/eluser]
You have to specify the RewriteBase if you install CI in a subdirecory.

Try the following .htaccess
Code:
RewriteEngine On
RewriteBase /countable_test/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

#3
[eluser]hardik[/eluser]
thanks a ton for the answer..
problem solved.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.