CodeIgniter Forums
sef urls issue when CI installed in sub directory - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: sef urls issue when CI installed in sub directory (/showthread.php?tid=11832)



sef urls issue when CI installed in sub directory - El Forum - 09-24-2008

[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?


sef urls issue when CI installed in sub directory - El Forum - 09-24-2008

[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]



sef urls issue when CI installed in sub directory - El Forum - 09-24-2008

[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


sef urls issue when CI installed in sub directory - El Forum - 09-25-2008

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

Thank you.

Obvious now that I see it.