$config['base_url'] = 'http://localhost/packagekartlive/';
$config['index_page'] = '';
.htaccess
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]
rewrite mode on.
FOR YOUR KIND INFORMATION
The same version of the application works fine on the live server and do no work in the local machine. I have tried almost all solutions on this site.
I have also tried the solution given in documentation of CodeIgniter as well.
Please suggest some quick fix.
Use this in .htacccess file
RewriteEngine on
RewriteCond $1 !^(index\.php|image|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
Or
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(index\.php|image|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
</IfModule>
If you're testing on a local server and are running WAMP, click on the Green WAMP icon in the taskbar. Scroll over Apache and then scroll over Apache Modules. Make sure that rewrite_module has a green checkmark next to it.
Related
Can any one help me?
I code a web app in php with codeigniter
it works well on my localhost but when I upload it on live server it loads only home page. For other pages it gives a error
''No input file specificed''
When I do google about it.
There are many tricks like change .htaccess but no one works.
What should I do
Check this
It loads foodpark.tk
But does not load
Foodpark.tk/category/index
And all the other pages
this is my .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|public|images|robots\.txt|css)
RewriteRule ^(.*)$ index.php/$1 [L]
Options -Indexes
i also tried to put a question mark after index.php in .htaccess but it gives 404 error from hosting
Sorry for my poor english
Try this in your .htaccess file
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?$1 [L]
Try this.
In your .htaccess file Change
RewriteRule ^(.*)$ index.php/$1 [L]
To
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
Try below code in .htaccess. This is from my working project. Hope you are using godaddy server.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
I have code .htacces that familiar when you using Codeigniter like this
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
But its not work. like this.
When I delete this .htacces, the code running well. I have been check mod_rewrite on apache is enable. I'm confused, need help please
TRY THIS
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /projectname
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>
Note: projectname is your root folder name
Even though you have mod_rewrite enabled, there is still a setting that can prevent .htaccess from working.
Check your httpd.conf file and make sure that in the directory settings that
AllowOverride None
is changed to
AllowOverride All
If you need more details than that, just ask! I've kept this very brief.
Try this in .htaccess
RewriteEngine on
RewriteBase /ci
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
and in application/config/config.php
$config['index_page'] = ''; // make it empty.
I have set WAMP up and running without too much hassle. But thing is I could not skip past index.php in my URL (localhost/index.php/login is working but localhost/login is not working).
Anyway my project is based on CI framework and I was using vagrant previously for hosting same project and which is working perfectly for this case. I have checked that the rewrite_module on for Apache and here it is my .htaccess file.
DirectoryIndex index.php
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
Please help me out from here.
First of all go in your project myproject-application->config.php
replace line no. 29
From
$config['index_page'] = 'index.php';
To
$config['index_page'] = '';
Then add .htaccess file on your root folder.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
Try this .htaccess file code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
I am new in codeigniter and i am trying to remove index.php from URL in Codeigniter but not able to do this.
I wrote code in my .htaccess file-
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
My Apache mod_rewrite is enable.
But still got 404 error when i am trying to access any controller without using index.php.
Please help.
Thanks.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/index/?$ $1 [L,R=301]
</IfModule>
Is the code I'm using, it works on every hosting platform I've used it on.
This should help you,
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
check this code of htaccess file.
DirectoryIndex index.php
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|public|images|css|js|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [L]
you can find your answer refference here
My .htaccess file is not working
moreover can you share your base url with us? as this error may be due to wrong baseurl set.
I search a lot websites and lots of links and i follow the same for enable htacces in wamp but facing the problem and now as default use index.php even when i run the page without index.php its not working even msg comes page not found on server i already enable in apache module also the httpd.conf file remove the # sign from rewrite module and i use the mention below code in htaccess file for codeigniter for suggestions i share htaccess code
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
please suggest so i can solve this issue on wamp server
Try this code in your htaccess :
RewriteEngine On
RewriteBase /my_project_name/
# Do not enable rewriting for files or directories that exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite to index.php/URL
RewriteRule ^(.*)$ index.php/$1 [PT,L]
Try this
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]