Welcome Guest, Not a member yet? Register   Sign In
Setting up mod_rewrite on Apache 2 (XAMPP)
#1

[eluser]playaz[/eluser]
Hi guys,

I have setup CodeIgniter 1.71 on my local machine, however seem to be having problems to remove the index.php from the URL by using mod_rewrite - has somebody set this up on XAMPP, if so can you assist me in anyway Smile

Thanks in advance
#2

[eluser]playaz[/eluser]
Ok.. really weird Apache seemed to fix itself? Seems to run fine now, not quite sure what happened but seems to all work fine now... I probably need some sleep :-)
#3

[eluser]Unknown[/eluser]
hi,

Hope you find good sleep, can you tell how to do this?

i am also using XAMPP,
currently i put the CI folder like

http://localhost/CodeIgniter/

i want the url to work like this,
http://localhost/CodeIgniter/register or
http://localhost/CodeIgniter/login/

and not

http://localhost/CodeIgniter/index.php/register/

Please help me on this

Thanks
Karthick B
#4

[eluser]TheFuzzy0ne[/eluser]
http://codeigniter.com/wiki/mod_rewrite/
#5

[eluser]playaz[/eluser]
Hi mate,

You'll basically need to do the following :-
1) make sure you enable mod_rewrite in Apache, simply find this line below and make sure it is NOT commented out in your httpd.conf file
LoadModule rewrite_module modules/mod_rewrite.so

2) Also create a .htaccess file, this needs to be within the root directory and make sure you don't remove the index.php file (as it is still required even though it doesn't appear to be).
The .htaccess I am using is as follows:-
# Customized error messages.
ErrorDocument 404 /index.php

# Set the default handler.
DirectoryIndex index.php

# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

Restart the Apache service and it should work fine now :-)

Hope that helps




Theme © iAndrew 2016 - Forum software by © MyBB