Welcome Guest, Not a member yet? Register   Sign In
codeigniter problem - site redirects to localhost in WAMP
#1

[eluser]departedmind[/eluser]
0 down vote favorite


i just copied the CI files from server to my localhost and I am having problem running the site.

Whenever i click the site link in WAMP http://localhost/CmpOnline/

it shows me the same folderlist as on localhost

this is my htaccess file current

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

and I tried this too
Code:
RewriteEngine on
RewriteBase /CmpOnline
RewriteCond $1 !^(index\.php|images|javascript|stylesheets|uploads|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]


and in the config file

Code:
$config['base_url'] = "http://localhost/CmpOnline/";

$config['index_page'] = "";

$config['uri_protocol'] = "REQUEST_URI";

I changes this to all the other available options but it still does not work


But it still does not work.

Any help?
#2

[eluser]InsiteFX[/eluser]
RewriteBase /CmpOnline/

InsiteFX
#3

[eluser]departedmind[/eluser]
shows this in the address bar http://localhost/CmpOnline/
but with the WAMP index page
#4

[eluser]InsiteFX[/eluser]
I have seen this happen because of this
Code:
$config['index_page'] = "";

// see if it works like this
$config['index_page'] = "index.php";
If it works then it means your .htaccess file is wrong.

InsiteFX
#5

[eluser]departedmind[/eluser]
Same problem, url is correct but still shows the wamp folder list. I also changes this
$config['uri_protocol'] = "AUTO"; to all other available options, still does not work.

Any help?
#6

[eluser]departedmind[/eluser]
When i try with this url
http://localhost/CmpOnline/index.php/main/
The page loads but css and javascripts does not load, when i check through firebug the path shows like this

http://localhost/javascript/common.js (for all the css, js and images)
#7

[eluser]InsiteFX[/eluser]
This is posted in the wrong forum topic ( No Code Allowed )

If you need help like this please post your question in the correct forum, then we can show you code to do it.

InsiteFX
#8

[eluser]jmb727[/eluser]
I had the same problem, remove the first forward slash from the rewrite rule.

From

Code:
RewriteEngine on
RewriteBase /CmpOnline
RewriteCond $1 !^(index\.php|images|javascript|stylesheets|uploads|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

To

Code:
RewriteEngine on
RewriteBase /CmpOnline
RewriteCond $1 !^(index\.php|images|javascript|stylesheets|uploads|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
#9

[eluser]Manjunath Reddy[/eluser]
I'm also facing the same problem.

Here is my config.php

Code:
$config['base_url']    = 'http://localhost/cicms/';
$config['index_page'] = "";
$config['uri_protocol']    = "AUTO";
$config['url_suffix'] = "";


and .htaccess
Code:
RewriteEngine On
RewriteBase /cicms/

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ index.php/$1 [L]

RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ index.php/$1 [NC]

RewriteRule ^admin$ admin.php?/$1 [NC]
RewriteRule ^admin/(.*)$ admin.php?/$1 [NC]

each time I click on any link it redirects to wamp home page.

it works fine if I include localhost/sitename/index.php/category
but it does not work if the link is localhost/sitename/category and this always redirects to wamp home page. I have tried all the possible ways mentioned above in this thread :-) couldn't make it work
I'm lost any help would be appreciated.
#10

[eluser]jmb727[/eluser]
[quote author="Manjunath Reddy" date="1311606129"]I'm also facing the same problem.

Here is my config.php

Code:
$config['base_url']    = 'http://localhost/cicms/';
$config['index_page'] = "";
$config['uri_protocol']    = "AUTO";
$config['url_suffix'] = "";


and .htaccess
Code:
RewriteEngine On
RewriteBase /cicms/

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ index.php/$1 [L]

RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ index.php/$1 [NC]

RewriteRule ^admin$ admin.php?/$1 [NC]
RewriteRule ^admin/(.*)$ admin.php?/$1 [NC]

each time I click on any link it redirects to wamp home page.

it works fine if I include localhost/sitename/index.php/category
but it does not work if the link is localhost/sitename/category and this always redirects to wamp home page. I have tried all the possible ways mentioned above in this thread :-) couldn't make it work
I'm lost any help would be appreciated.[/quote]


Hi there, I've had this problem before with WAMP.
WAMP doesn't come with mod_rewrite turned on by default.
Open up C:\wamp\bin\apache\Apache 2.x.x\conf\httpd.conf
Use CTLR+F to find 'mod_rewrite' without the quotes and remove the # at the beginning of the line then restart wamp.




Theme © iAndrew 2016 - Forum software by © MyBB