Welcome Guest, Not a member yet? Register   Sign In
URL's not working on localhost
#1

[eluser]adaykin[/eluser]
I'm having problems with URL's on a localhost. On my webserver they are working fine. The only page that is working on the localhost is the home page http://localhost/Home. All the other pages give a 404 or, when they do load, have absolutely nothing in them(no HTML whatsoever).

Here is my .htaccess file:

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

And here is what is in my config file:
Code:
$config['base_url'] = "http://localhost/Home/";
$config['index_page'] = "";

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

Everything is working fine though on my web server: http://andydaykin.com/Home/
#2

[eluser]bigtony[/eluser]
Is 'Home' also the name of your controller? If so, there seems to be a duplication by using the same name also as a directory in your web root. Best not to use controllers names the same as directories.
#3

[eluser]Skuja[/eluser]
Do you have mod_rewrite module enabled in your php configuration (php.ini) on local machine?
Also check out web servers error log file.
#4

[eluser]jdfwarrior[/eluser]
Are you using apache as your local web server?
#5

[eluser]adaykin[/eluser]
Yeah I'm using apache, it's windows + apache + mysql + php (wampserver). I checked the error log, but nothing. Mod_rewrite is working too, I've gotten it to work with the Zend Framework. Maybe I need to put something different in my .htaccess file, what are other people using in it?
#6

[eluser]jdfwarrior[/eluser]
Remove/rename .htaccess and make sure you have a base install without working. Eliminate .htaccess as being a problem and work from there.
#7

[eluser]adaykin[/eluser]
Well, if I get rid of the .htaccess and change my config.php to work without it, it works fine.

It's interesting that the exact same setup will work on my remote server, but not on a local host (I obviously have to change paths when I upload so it reflects the correct value on the server). Should anything in my config.php or .htacess be changed?
#8

[eluser]wowdezign[/eluser]
I have a similar issue with my local server verses the production server(s). I have found that changing the

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

line solves my particular issue. I just tried different settings. Once I found the right set up for both my local and production servers, I put conditionals in index.php file that set the config parameters based on a SITE_IS_LIVE constant that gets set to true if live and false if local.
#9

[eluser]wowdezign[/eluser]
I didn't mention it before but the other setting that I use is:
Code:
$config['uri_protocol'] = "AUTO";
#10

[eluser]adaykin[/eluser]
[quote author="wowdezign" date="1249463119"]I didn't mention it before but the other setting that I use is:
Code:
$config['uri_protocol'] = "AUTO";
[/quote]

Thanks! That did it for me, all URL's are working now!




Theme © iAndrew 2016 - Forum software by © MyBB