I 've been using CodeIgniter in XAMPP. There was no problem to redirect to a function URL (e.g., function1):
http://localhost/function1
When I changed to WAMP, I got a problem. I could not redirect to function1. However, function1 is still accessed at:
http://localhost/index.php/function1
How to configure WAMP and CodeIgniter to remove index.php? In order that I could run function1 as I run using XAMPP.
Thank you.
To remove the “index. php” from your site's URLs, you will first need to make sure your server is set up to pass would-be 404 requests off to Craft's index. php file behind the scenes. If you're running Apache, you can do that by creating a redirect in your site's .
Please try the following:
1) Create .htaccess file in parallel to application folder and just copy paste the following code:
RewriteEngine On
RewriteBase /CodeIgniter/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
2) Change $config['index_page']
to blank in config.php
in application folder as below:
$config['index_page'] = '';
3) Enable "rewrite_module
" of apache. Click on WAMP symbol -> Apache -> Apache modules -> rewrite_module
Now you can access your site without index.php in url.
Create an .htaccess
file if you didn't already have one and add this code in it:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
Make sure you place this in the same directory as your index.php
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With