Welcome Guest, Not a member yet? Register   Sign In
sef urls issue when CI installed in sub directory
#1

[eluser]nvhack[/eluser]
my pages load correctly when I use a url like
http://localhost/ci/index.php?mytest
but not when I use urls like this
http://localhost/ci/mytest

It routes me back to
http://localhost/
not
http://localhost/ci/

I use XAMPP as my laptop server and I develop many sites from subdirectories So I really want it installed in the subdirectory.

Is there a way of fixing this? Perhaps via the route.php?

I have my base_url set

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

and have tried all of these options instead of AUTO
Code:
| 'AUTO'            Default - auto detects
| 'PATH_INFO'        Uses the PATH_INFO
| 'QUERY_STRING'    Uses the QUERY_STRING
| 'REQUEST_URI'        Uses the REQUEST_URI
| 'ORIG_PATH_INFO'    Uses the ORIG_PATH_INFO


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

my htaccess file is
Code:
RewriteEngine on
#RewriteBase /ci163     ## Tries this but no difference.

RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

Any ideas?
#2

[eluser]Pascal Kriete[/eluser]
It's almost definitely the htaccess file. Is it in the CI directory, or in the web root? (should be the former)

Try this:
Code:
RewriteEngine on

RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /ci/index.php/$1 [L]
#3

[eluser]metaltapimenye[/eluser]
[quote author="inparo" date="1222328126"]It's almost definitely the htaccess file. Is it in the CI directory, or in the web root? (should be the former)

Try this:
Code:
RewriteEngine on

RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /ci/index.php/$1 [L]
[/quote]
i agree,..
else, check your vhost.conf, make sure there's no fishy related to .htaccess ..Smile
#4

[eluser]nvhack[/eluser]
Yes! that was it.

Thank you.

Obvious now that I see it.




Theme © iAndrew 2016 - Forum software by © MyBB